Trouble with regression model: SSR re- and unrestricted

I have a question concerning a task in which I should test, with the help of a suitable dummy variable design, whether the experience for men and women at the same educational level (= dummy variable) has a different effect on the log(wage).

The null hypothesis is that both interaction effects Erf * Weibl and Erf2 * Weibl are simultaneously equal to Zero.

HBA stands for the highest level of education, that is the dummy variable.
Weibl stand for women and Erf means experiance.

lm.stdl_r <- lm(log(StdL) ~ HBA + I(Erf*Weibl) + I(Erf^2*Weibl), data = subset(stdl_44))
SSR_r <- deviance(lm.stdl_r)
SSR_r # SSR for the restricted modell
lm.stdl_u1 <- lm(log(StdL) ~ HBA + I(Erf*Weibl) + I(Erf^2*Weibl), data = subset(stdl_44, Weibl == 1))
SSR_u1 <- deviance(lm.stdl_u1) # SSR fuer nicht restringiertes Modell
lm.stdl_u2 <- lm(log(StdL) ~ HBA + I(Erf*Weibl) + I(Erf^2*Weibl), data = subset(stdl_44, Weibl == 0))
SSR_u2 <- deviance(lm.stdl_u2) # SSR for unrestricted model
SSR_u <- SSR_u1 + SSR_u2
SSR_u # SSR for the whole unrestricted model

With this code I don't get the wright answer and I am not able to find my mistake...

Thank you very much in advance for your help!


There's no way to know without seeing the data.

Can you please provide a minimal reprex (reproducible example)? The goal of a reprex is to make it as easy as possible for me to recreate your problem so that I can fix it: please help me help you!

If you've never heard of a reprex before, start by reading "What is a reprex", and follow the advice further down that page.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.