lab11 - STAT5044: Lab11 Inyoung Kim Outline 1 How to fit...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: STAT5044: Lab11 Inyoung Kim Outline 1 How to fit GLM using R Example for logistic regression The logistic model we start with the relates the probability of developing Kyphosis to the three predictor variables, Age , Number , and Start . We fit the model using glm Call data Read data > #1. call data kyphosis<-read.table("/Users/inyoungkim/inyoung/Teaching/Stat5044/Fall2009/lab/kyphosis.txt",header=T) > summary(kyphosis) obs Kyphosis Age Number Start Min. : 1.00 absent :64 Min. : 1.00 Min. : 2.000 Min. : 1.00 1st Qu.:22.00 present:17 1st Qu.: 26.00 1st Qu.: 3.000 1st Qu.: 9.00 Median :43.00 Median : 87.00 Median : 4.000 Median :13.00 Mean :42.51 Mean : 83.65 Mean : 4.049 Mean :11.49 3rd Qu.:63.00 3rd Qu.:130.00 3rd Qu.: 5.000 3rd Qu.:16.00 Max. :83.00 Max. :206.00 Max. :10.000 Max. :18.00 Boxplot Box plot absent present 50 100 150 200 Kyphosis Age absent present 2 4 6 8 10 Kyphosis Number absent present 5 10 15 Kyphosis Start Logistic regression Summary statistic > kyph.glm.all<-glm(KyphosisAge+Number+Start,family=binomial(),data=kyphosis) > summary(kyph.glm.all) Call: glm(formula = Kyphosis Age + Number + Start, family = binomial(), data = kyphosis) Deviance Residuals: Min 1Q Median 3Q Max-2.3124-0.5484-0.3632-0.1659 2.1613 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -2.036934 1.449575-1.405 0.15996 Age 0.010930 0.0064460....
View Full Document

Page1 / 17

lab11 - STAT5044: Lab11 Inyoung Kim Outline 1 How to fit...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online