# Confidence interval for prediction in R [closed]

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.

-
 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.

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.