I want two different lines for men and women in the same plot but I always get non-sense lines when I run this code. What is the problem and how can I solve it
library(wooldridge)
attach(wage1)
MODEL3=lm(log(wage)~educ+female+female*educ+exper+expersq+tenure+tenursq)
summary(MODEL3)
fix(wage1)
id <- wage1$female >= 1
plot(wage1$educ[!id], wage1$wage[!id],
pch = 20,
col = "red",
main = "",
xlab = "Class Size",
ylab = "Test Score")
points(wage1$educ[id], wage1$wage[id],
pch = 20,
col = "green")
coefs <- MODEL3$coefficients
abline(coefs[1], coefs[2],
col = "red",
lwd = 1.5)
abline(coef = c(coefs[1] + coefs[3], coefs[2] + coefs[4]),
col = "green",
lwd = 1.5 )