Comparing 2 models with anova in R? I'm struggling to interpret this outcome.
I have 2 models
Model_1 <- lm(formula = gamble ~ income * gender)
Model_2 <- lm(formula = gamble ~ income + gender)

Now, I'm struggling to understand if these are nested and if so which one is full and which is reduced.
Then if i try to select a better one using anova(Model_1, Model_2) I get this output:
** Model 1: gamble ~ income * gender
Model 2: gamble ~ income + factor(gender)
  Res.Df   RSS Df Sum of Sq      F   Pr(>F)   
1     43 18930                                
2     44 22781 -1   -3851.4 8.7486 0.005018 **

It seems like the $p$ value is significant in favour of one of the models. Which one would that be?
 A: Model 2 is nested within Model 1, as setting the income:gender parameter in Model 1 equal to zero results in Model 2. Thus, Model 2 is the reduced model.
Model 1
$
\hat{y} = \hat{\beta}_0 + \hat{\beta}_1 x_{income} + \hat{\beta}_2x_{gender} + \hat{\beta}_3 x_{income}x_{gender}
$
Model 2
$
\hat{y} = \hat{\beta}_0 + \hat{\beta}_1 x_{income} + \hat{\beta}_2x_{gender}
$
What the anova function does is test if the parameters in the full model that are not in the reduced model are nonzero. You have a fairly small p-value, indicating that there is something nonzero in the full model that is not in the reduced model. Only $\beta_3$ is in the full model but not the reduced model.
A: *

*Your models are nested. In the R formula language, : means interaction, while * means "expand into a sum plus the interaction". So the term income * gender expands into income + gender + income:gender, in effect including the possibility that slopes of income differs between genders, while the simpler model without the interaction assumes that slopes of<income are equal for genders, only the intercepts might differ (if income also is categorical, an analogous interpretation).


*The full model is the one with interaction Model_1, so the reduced model is Model_2.


*In your output you get negative df and negative SS. Thatb is because you had arguments to anova in the wrong order. The arguments should be in order of increasing complexity, so anova(Model_2, Model_1)


*The conclusion is that the full model (with interaction) is significant, as compared to the reduced model.
