Following this R instruction
> fit <- lm(spending ~ sex + status + income + verbal, data=spending)
I would like to calculate the mean and median of the residuals. Both my friend and I get different answers for the mean for the same data.
> mean(resid(fit))  -3.065293e-17
while with the other model, results are:
> fit1<- lm(spending ~ status + income + sex + verbal, data=spending) > mean(resid(fit1))  4.064605e-16
Why did we get the same median but different mean if we are using the same data set?