[R] predict function the other way around
dwinsemius at comcast.net
Mon May 11 18:29:18 CEST 2009
Why not use the x=T and y=T paramemters and see if :
linearmodel=lm(y~x, x=T, y=T)linearmodel$model
1 2 1
2 4 2
3 6 3
4 8 4
5 10 5
.... give you useful results. If you want to interpolate or
extrapolate, then search for threads regarding those tasks.
On May 11, 2009, at 11:20 AM, Gerrit Voigt wrote:
> Dear List,
> Consider the following example
> To predict a y-value if you know the corresponding x value is very
> easy with the command predict.
> predict(linearmodel, newdata=(x=1.5))
> The other way around, to predict an x-value with a corresponding y-
> value, doesn't work unfortunately.
> Is there another function that can do that, or do I need to solve
> that problem the classical way?
> Thanks in advance
> Gerrit Voigt
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
David Winsemius, MD
West Hartford, CT
More information about the R-help