Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

Using a data set from R, I need to find a 95% CI to predict a female with average study, homework, and scores would pass SAT. Then I need to repeat the prediction for a female with maximal values for study, hw and scores and determine which is wider.

I know I have to do a predict() using my original to get the average lm given

fit<-lm(sat ~ study + homework + score + gender) 

Problem: I don't know how to predict with maximal values for the variables or determine which is wider.

share|improve this question
this is my first question but using Michelle's computer to work together in a group of 4 to review and practice for class. I think it override her name because there are points next to my name now. – jerry Sep 25 '12 at 13:43

closed as off topic by whuber Mar 1 at 22:36

Questions on Cross Validated are expected to relate to statistics within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

1 Answer

Look at the help page for the predict.lm function (you can just call predict on your lm object and this function will be run). You can use the summary function on the original data to see the mean and maximum (and other) values. Then you need to create a new data frame with the same column names as the original data, on one row put in the mean values, on another row put in the maximum values.

When you call predict you will use this new data frame as the newdata argument. Then look at the description of the interval argument in the help page.

share|improve this answer
I see responses that CI will be narrower. But what we need to determine which is wider between our prediction of "female on mean" or "female on maximal". Mean will be narrower since it fits the the observation of our data, is more precise. – jerry Sep 27 '12 at 15:44
So calculate the 2 intervals and measure which is wider. There should be enough information in the answer (and the help pages referenced) for you to do that. – Greg Snow Sep 27 '12 at 16:33
I calculated the 2 intervals as such, mean gives: lwr upr 1 28.11506 -18.76032 74.99044 max values fit lwr upr 1 71.30794 17.06588 125.55 so by the information,mean is narrower because the values are closer for the lower and upper bands. – jerry Sep 27 '12 at 16:47

Not the answer you're looking for? Browse other questions tagged or ask your own question.