lab3 - STAT5044 Lab3 Inyoung Kim Outline 1 How to check...

Info icon This preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
STAT5044: Lab3 Inyoung Kim
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Outline 1 How to check assumptions using R
Image of page 2
Example A health researcher, interested in studying the relationship between diastolic blood pressure and age among healthy adult women 20 to 60 years odl, collected data on 54 subjects. (Text book 427)
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Call data Read data data3<-read.table("d:/data/CH11TA01.txt",header=F) x<-data3[,1] y<-data3[,2] lmfit<-lm(y˜x)
Image of page 4
Simple linear regression Simple linear fit summary(lmfit) Call: lm(formula = y ˜ x) Residuals: Min 1Q Median 3Q Max -16.47859 -5.78765 -0.07844 5.61173 19.78132 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 56.15693 3.99367 14.061 < 2e-16 *** x 0.58003 0.09695 5.983 2.05e-07 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 8.146 on 52 degrees of freedom Multiple R-squared: 0.4077, Adjusted R-squared: 0.3963 F-statistic: 35.79 on 1 and 52 DF, p-value: 2.050e-07
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Scatter plot Scatter plot 20 30 40 50 60 70 80 90 100 110 x y
Image of page 6
Cooks distancs for influence ploints Cooks distance par(mfcol=c(2,3)) cook<-cooks.distance(lmfit) halfnorm(cook,3,ylab="Cooks dist") boxplot(cook)
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Residual plot Residual plot #3.1 constant var plot(fitted(lmfit),residuals(lmfit),xlab="Fitted",ylab="Residuals") abline(h=0) plot(fitted(lmfit),abs(residuals(lmfit)),xlab="Fitted",ylab="|Residuals|" )
Image of page 8
Image of page 9
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