Hi,

Is it just me or it appears the "temperature" and "probability" should be
reversed? 
--------
Anyhow it should help you to assign your model to a variable (as Joshua did
with his own suggestion)

yourmodel <-lm(x[,2] ~ x[,1] + I(x[,1]^2)) # again, taking literally the way
you formulated it...

And you could then access the coefficients individually:

c <- coef(yourmodel)[1] # for the intercept 
b <- coef(yourmodel)[2] 
a <- coef(yourmodel)[3] 

To build yourself a vector of predicted y-values based on a vector of
x-values ("dat" as per Joshua's post)
and pass them to the "lines" function to be plotted over your existing plot.

This is less convenient than using the "predict" but sometimes it helps to
do the arithmetic at a lower level.
HTH


--
View this message in context: 
http://r.789695.n4.nabble.com/Plotting-a-quadratic-line-on-top-of-an-xy-scatterplot-tp3443018p3443693.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to