Thursday, February 21, 2019
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
Wednesday, February 20, 2019
Monday, February 11, 2019
Thursday, February 7, 2019
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
> 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
> 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
Subscribe to:
Comments (Atom)


