{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# Rforch4 - R for Chapter 4 Running List of Functions Applied...

This preview shows page 1. Sign up to view the full content.

R for Chapter 4 Running List of Functions Applied to the Data Set, data.class: > attach(data.class) > reg < - lm(weight ~ height) >summary(reg) ## Suppose we want to find three confidence intervals for the average weight at heights ## height = 60, 65 and 70 inches, respectively. Moreover, we want these intervals to simultaneously ## contain their means with a probability of at least .88. > predict(reg,newdata=data.frame(height=c(60,65,70)),se.fit=TRUE, interval="confidence", pred.var=TRUE,level=.96) ## Suppose now we want to predict the weight of three individuals at heights ## height = 60, 65 and 70 inches, respectively. Moreover, we want these three prediction intervals ## to simultaneously contain their weights with a probability of at least .88. > predict(reg,newdata=data.frame(height=c(60,65,70)),se.fit=TRUE, interval="predict", pred.var=TRUE,level=.96) ## We now seek to graph 95% confidence intervals and prediction intervals ## over the range of possible X values, forming bands around the fitted line. ## This is NOT a band that covers all possible X values simultaneously with probability .95
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern