Dear list users



How is it possible to visualise both a linear trend line and a quadratic trend 
line on a plot
of two variables?



Here my almost working exsample.



data(Duncan)

attach(Duncan)

plot(prestige ~ income)

abline(lm(prestige ~ income), col=2, lwd=2)



Now I would like to add yet another trend line, but this time a quadratic one. 
So I have two
trend lines. One linear trend line and a quadratic trend line. A trend line as 
if I had taken
I(income^2) into the equation.



I know I can make two models and compare them using anova, but for pedagogical 
resons I wold
like to visualise it. I know the trick from my past as an SPSS user, but I 
would like to do
this in R as well. Se it in SPSS
http://www.childrens-mercy.org/stats/weblog2006/QuadraticRegression.asp



Thanks in adcance



Eric

______________________________________________
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