I'm still working on R problems from a book, and using my spending data.
Part 1: I need to predict the amount that a male with average data for status, income and verbal would spend along a 95% CI. (NB, male is coded as 0 and female 1 in the data set.)
First I used the linear model
newspend<-lm(sepnding ~ status + income + verbal + sex) and from a previous question the sex coefficient is for female, so how would I get the male?
> qt(0.975,42)  2.018082 > c(-22.12-2.02*8.21,-22.12+2.02*8.21)  -38.7042 -5.5358
First Question: I don't know how what this means and how will I get a 95% CI for males if this is for females?
Part 2: Then repeat the prediction for males with maximal values of status, income and verbal and determine which CI is wider. Second, I used the max. values for the data in a new equation.
sex status income Min. :0.0000 Min. :18.00 Min. : 0.600 1st Qu.:0.0000 1st Qu.:28.00 1st Qu.: 2.000 Median :0.0000 Median :43.00 Median : 3.250 Mean :0.4043 Mean :45.23 Mean : 4.642 3rd Qu.:1.0000 3rd Qu.:61.50 3rd Qu.: 6.210 Max. :1.0000 Max. :75.00 Max. :15.000 verbal spending Min. : 1.00 Min. : 0.0 1st Qu.: 6.00 1st Qu.: 1.1 Median : 7.00 Median : 6.0 Mean : 6.66 Mean : 19.3 3rd Qu.: 8.00 3rd Qu.: 19.4 Max. :10.00 Max. :156.0
x0<-data.frame(status=75.00, income=15.00, verbal=10.00, sex=1.00)
I'm not sure if this is how I get the maximal values for a male? (Or should the 2nd part be a new question since it's a lot of information?)