[R] Graphing a non-linear regresion line on a scatter plot.

Baigo martin_baigorria at hotmail.com
Mon Nov 12 00:46:25 CET 2012


Hey

I've been attempting to draw the non-parametric part of a regression on a
scatter plot, with confidence intervals if possible. Even if I tried, I
failed, reason why I'm asking here 

library(np)
library(foreign)  

wage1 <- read.dta(file="PATH HERE\\wage1.dta")
reg.np <- npplreg(lwage ~ female + married + educ + tenure | exper, data =
wage1)

plot(reg.np)

plot(wage1$exper, wage1$lwage, xlab = "age", ylab = "log(wage)")
lines(wage1$exper, fitted(reg.np), lty = 1, col = "blue")

This was one of the many attempts I tried. I'd really appreciate if someone
could help.

wage1 Database: http://www.sendspace.com/file/txksv3

Thanks!

Martín



--
View this message in context: http://r.789695.n4.nabble.com/Graphing-a-non-linear-regresion-line-on-a-scatter-plot-tp4649268.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list