我一直在尝试在散点图上绘制回归的非参数部分,如果可能的话,使用置信区间。即使我尝试了,我也失败了,为什么我在这里问
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")
这是我尝试的众多尝试之一。如果有人可以提供帮助,我将不胜感激。