{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

View Full Document Right Arrow Icon
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
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern