similar to: linear extrapolation using data from imported text file

Displaying 20 results from an estimated 4000 matches similar to: "linear extrapolation using data from imported text file"

2017 Jun 16
2
"reverse" quantile function
Peter, thanks, very nice, this will work for me... could you also help with setting up the code to run the on liner "approx(sort(x), seq(0,1,,length(x)), q)$y" on the rows of a data frame using my example above? So if I cbind z and res,? df<-cbind(z,res) the "x" in your one liner would be the first 4 column values of each row and "q" is the last (5fth) column
2017 Jun 16
0
"reverse" quantile function
It would depend on which one of the 9 quantile definitions you are using. The discontinuous ones aren't invertible, and the continuous ones won't be either, if there are ties in the data. This said, it should just be a matter of setting up the inverse of a piecewise linear function. To set ideas, try x <- rnorm(5) curve(quantile(x,p), xname="p") The breakpoints for the
2006 Aug 04
0
Question regarding extrapolation
Hi, I am facing a problem in extrapolation of data series. It is a series of Bond yields, I am having the yield for 1 year to 30 years. I want to find the yield for 0.5 year and 30.5 years. I used the Langrange's Extrapolation but the extrapolation deviates from the normal trend ( as we can see in theoritical yield curves) very sharply, as go on increasing my years from 30 years to 35 years
2024 Jan 14
0
Plotting extrapolation with R like AUTOBOX does
Dear R-experts, I write to you to know if somebody is aware of a R package (or function) able to plot graphs for extrapolation. I need to be clear on what extrapolation really is to me. It is when we use the model for X variables outside the range of X variables that were used to construct the model and estimates.? What I am really looking for is that beyond confidence intervals for predictions
2013 Jun 18
1
deSolve question
Dear All wonder if you could provide some insights on the following: currently I have this code which produces the expected results: require(deSolve) pars <- list(k = 0.08,v=15) intimes <- c(0,0.5,12) input <- c(800,0,0) forc <- approxfun(intimes, input, method="constant", rule=2) derivs <- function(t, state, pars) { inp <- forc(t) dy1 <- - pars$k * state[1]
2014 Jul 08
0
Extrapolation of rarefaction curve
Hi all, I used R (vegan package) to make rarefaction curves and I calculated the Chao index for each curve. However, the plateau is far from reached. What I want to do now is the following: Based on the Chao index, I want to extrapolate the curve so I get an x-value which gives me an estimation of the total number of clones I'd have to pick up and sequence in order to have a full coverage of
2023 Oct 26
2
Plot for 10 years extrapolation
Dear R-Experts, Here below my R code working but I don't know how to complete/finish my R code to get the final plot with the extrapolation for the10 more years. Indeed, I try to extrapolate my data with a linear fit over the next 10 years. So I create a date sequence for the next 10 years and store as a dataframe to make the prediction possible. Now, I am trying to get the plot with the
2011 Jan 29
1
data extrapolation function
Readers, Data was imported using the read csv command: dataimport<-read.csv("/path/to/dataimport.csv") 10,2000 12,2001 13,2002 15,2003 17,2004 Using the help contents for 'predict.lm' (i.e. ?predict.lm) a new data frame was created dataimportextra<-data.frame(x=seq(1990,2010,1)) predict(lm(dataimport),dataimportextra[,2],se.fit=TRUE)
2012 Aug 30
2
Help on Plot Title where text is "mixed" with numerical carachters
Dear All,   I have the following code set up:   x <-2000 y <-8 z <-3   I would need to use these numbers to show up in my plot title "mixed" with text. The x,y,z numbers would need to change, the text would not. So my title should look like this   "x txt1 y txt2 z txt3"   so if: txt1=hours txt2=minutes txt3=seconds   then my title of the plot should read:   2000 hours
2013 Jun 18
2
find closest value in a vector based on another vector values
Dear All, would you please provide your thoughts on the following: let us say I have: a <-c(1,5,8,15,32,69) b <-c(8.5,33) and I would like to extract from "a" the two values that are closest to the values in "b", where the length of this vectors may change but b will allways be shorter than "a". So at the end based on this example I should have the result
2010 May 26
2
Survival analysis extrapolation
Dear all, I'm trying to fit a curve to some 1 year failure-time data, so that I can extrapolate and predict failure rates up to 3 years. The data is in the general form: Treatment Time Status Treatment A 28 0 Treatment B 28 0 Treatment B 28 0 Treatment A 28
2012 Aug 31
3
Help on numerical object and ifelse function
Dear All,   this is probably an easy one but I can not get a handle on it:   x <-c(1,2,3,4,5) y <-c(6,7,8,9,10) z <-15 w <-ifelse(z>14,x,y)   this will give me a value of 1 for w. What I would like to get is the whole string of x, so that w would become a numeric object of 5 characters exactly the same as x.   Apreciate the help,   Sincerely,   Andras [[alternative HTML version
2013 Jan 25
5
Loop question?
Dear All   I have the following data (somewhat simplyfied):   TINF <-1 a <-c(500,750,1000,1250,1500,1750,2000) b <-c(8,12,18,24,36,48,60,72,96)   following function:   infcprodessa <-function (D, tin, tau, ts)   (D * (1 - exp(-0.048 * tin))/(tin * (0.048*79) * (1 - exp(-0.048 * tau)))) * exp(-0.048 * (ts - tin)) z <-sapply(1:1, function(n) infcprodessa(1000,TINF,12,12-TINF))   is
2012 Sep 02
3
Help on finding specific columns in matrix
Dear All,   I have a matrix with 33 columns and 5000 rows. I would like to find 2 specific columns in the set: the one that holds the highest values and the one that holds the lowest values. In this case the column's mean would be apropriate to use to try to find those specific columns because each columns mean is different and they all change together based on the same "change of rate
2012 Sep 08
3
Apply a function to columns of a matrix
Dear All,   as a follow up to my previous e-mail (I think I am getting closer...):   I am trying to apply the trapezoidal functions to a matric column by column. I have the following code:   a <-matrix(c(1:100),ncol=10) b <-matrix(c(2,4,6,8,10,12,14,16,18,20))   apply(a,2,function(b,a) sum(diff(b)*(a[-1]+a[-length(a)]))/2)   for some reason i get an error message: Error in FUN(newX[[, i],
2012 Dec 01
3
screen if a value is within range
Dear all,   could you please give me some pointers on how I could make R screen for a value if it falls within a certain range? I looked at the subset function, but is not doing it, perhaps because I only have 1 value to screen?   aptreciate the input   ex: a <-16.5 I would like to screen to see if a is within the range of 15 to 20, (which it is:-)), and I would like the code to return a value
2012 Sep 12
2
Help on converting a Sweave document to PDF
Dear All,   I am working with a Sweave document to be converted into PDF using Rstudio. It seems to me that my R code will also show up after conversion, which I would like not to happen. Is there a way to specify a command that I could place on the beggining and at the end of the R code that would allow R to recognize the area where my R code is and would ignor it when the data is converted?  
2009 Apr 14
4
Forcing the extrapolation of loess through the origin
Hi all, I'm fitting a line to my dataset. Later I want to predict missing values that exceed the [min,max] interval of my empirical data, therefore I choose surface="direct" for extrapolation. l1<-loess(y1~x1,span=0.1,data.frame(x=x1,y=y1),control=loess.control(surface="direct")) In my application it is highly important that the fitted line intercepts at the point of
2012 Jun 07
4
"Re-creating" distributions
Dear All,   I often have to work with certain models in which I try to "reproduce" a distribution the best I can with very little known information avaible. Is there a package or function in R that could best reproduce a probability distribution using only the mean, median and SD values availble without knowing the actual distribution type to begin with and/or the covariance matrix (for
2019 May 10
0
[R] approx with NAs --> new argument 'na.rm=TRUE' ?!
I have now committed a version "fulfilling" your wish, partly at least, to R-devel . In the new approx(*, na.rm=FALSE) cases, the result of how NA's are treated does depend on the 4 different extrapolation rules {1, 2, 1:2, 2:1} The main reason was that I kept the low level code in C to do +- what it did before which automatically was using 'rule' to determine these