Thursday, February 21, 2019

Worksheet 2 x 2 table. Odds ratio with logistic regression printout.

https://drive.google.com/file/d/0B0G6ga3ykYRHVHhtYVZQNndlU0U/view?usp=sharing

Logistic Regression Example 1 Using R. CHD and AGE


Call:
glm(formula = CHD ~ AGE, family = binomial(logit), data = chd)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-1.9718  -0.8456  -0.4576   0.8253   2.2859  

Coefficients:
            Estimate Std. Error z value Pr(>|z|)    
(Intercept) -5.30945    1.13365  -4.683 2.82e-06 ***
AGE          0.11092    0.02406   4.610 4.02e-06 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 136.66  on 99  degrees of freedom
Residual deviance: 107.35  on 98  degrees of freedom
AIC: 111.35

A First Glance at Logistic Regression. A Continuous Predictor and Two Level Categorical Example

https://drive.google.com/file/d/0B0G6ga3ykYRHZmczZkJjbDM2eGc/view?usp=sharing

Dr. David Weeks

https://drive.google.com/open?id=14_SL7xDzyHZaD2wyyAZQewCm6cotbMqv

Worksheet (Good Exam Review)

click

Demo of Forward and Backward Stepwise and Best Subsets Model Selection Procedures. Not on Exam.

https://drive.google.com/open?id=1Mx8lO3FO5YFFBMitq497GWrNxe-sINlx

Good Exam Review: Simple Linear Regression Case Study 1. This is the printout for the worksheet. LOS and Age for Senic Data Set.

https://drive.google.com/file/d/118QAWe--3YeHz8xn5p4LsuIVo_UECK4Y/view?usp=sharing

Good Exam 1 Review: Answers to Simple Linear Regression Worksheet LOS and Age

https://drive.google.com/file/d/0B0G6ga3ykYRHbEJXZjc2SDlCVDA/view?usp=sharing

Thursday, February 7, 2019

Homework Problem 13.26 and 13.27 Department Store Data. Example of Interaction Testing Using Partial F Test. A printout using R. A full and reduced model.

https://drive.google.com/file/d/0B0G6ga3ykYRHX3hVSG14dkdqOTg/view?usp=sharing

Answers to B1 book problem: Sales in 3 Departments Problem 13.26 and 13.27


https://drive.google.com/file/d/0B0G6ga3ykYRHZFJHRVdYVDBLZVE/view?usp=sharing

Output for Problem 4.40 in B2 Book

> wafer.lm=lm(FAILTIME~TEMP+I(TEMP^2),data=WAFER)
> summary(wafer.lm)

Call:
lm(formula = FAILTIME ~ TEMP + I(TEMP^2), data = WAFER)

Residuals:
     Min       1Q   Median       3Q      Max 
-1260.49  -475.70   -15.57   528.45  1131.69 

Coefficients:
              Estimate Std. Error t value Pr(>|t|)    
(Intercept) 154242.914  21868.474   7.053 1.03e-06 ***
TEMP         -1908.850    303.664  -6.286 4.92e-06 ***
I(TEMP^2)        5.929      1.048   5.659 1.86e-05 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 688.1 on 19 degrees of freedom
Multiple R-squared:  0.9415, Adjusted R-squared:  0.9354 
F-statistic: 152.9 on 2 and 19 DF,  p-value: 1.937e-12


Using Estimation Equation for Temp= 140 and 150.
Note 140^2 =  19600 
Note 150^2 =  22500

(Failtime | temp = 140) = 154242.914 - 1908.850(140) + 5.929 (19600)
                        = 3211.191

R Command to compute:↔
predict(wafer.lm,data.frame(TEMP=c(140,150)))
       1        2 

3211.191 1316.629 

Quadratic Regression : Output for Problem 4.41 in B2 Book

> plot(Time,SPRate,main="Problem 4.40 in B2 Book")
> rad.lm=lm(SPRate~Time+I(Time^2),data=RADICALS)
> summary(rad.lm)

Call:
lm(formula = SPRate ~ Time + I(Time^2), data = RADICALS)

Residuals:
     Min       1Q   Median       3Q      Max 
-0.14134 -0.06653 -0.02948  0.08310  0.13967 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  1.00705    0.07899  12.749 2.46e-08 ***
Time        -1.16712    0.12191  -9.574 5.72e-07 ***
I(Time^2)    0.28975    0.03937   7.360 8.73e-06 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.1011 on 12 degrees of freedom
Multiple R-squared:  0.9265, Adjusted R-squared:  0.9143 
F-statistic: 75.65 on 2 and 12 DF,  p-value: 1.574e-07



Written Dialogue Associated with Quadratic Regression Exercises from B2 Book. Problems 4.40 and 4.41

https://drive.google.com/open?id=1AeNk3ehzZ0NXcqqXgZcnvl89QVky3IPB

Senic Data Mult Linear Regression. Compare 2 models with all continuous predictors

https://drive.google.com/file/d/0B0G6ga3ykYRHY1REOE5SXzlwMXc/view?usp=sharing