HW 4
HW 4
HW 4
HW4
Chapter 9: 9.5, 9.24
30
20
25
VO2_Max
35
40
9.5
c) (Intercept)
3.158795
Duration
0.05029231
d)
350
400
450
500
Duration
e)
9.58902
3.096614
f)
660
38.1
36.35172
1.748278
0.571421
628
38.4
34.74237
3.657632
1.195489
637
41.7
35.195
6.505002
2.126146
575
33.5
32.07688
1.423125
0.465145
550
600
650
g)
590
28.6
32.83126
-4.23126
-1.38298
600
23.9
33.33418
-9.43418
-3.08354
562
29.6
31.42307
-1.82307
-0.59587
495
27.3
28.05349
-0.75349
-0.24628
540
33.2
30.31664
2.883356
0.942419
470
26.6
26.79618
-0.19618
-0.06412
408
23.6
23.67806
-0.07806
-0.02551
387
23.1
22.62192
0.47808
0.156259
564
36.6
31.52366
5.07634
1.659191
603
35.8
33.48506
2.31494
0.756633
420
28
24.28157
3.718433
1.215362
573
33.8
31.97629
1.82371
0.596076
602
33.6
33.43477
0.165233
0.054006
430
21
24.78449
-3.78449
-1.23695
508
31.2
28.70729
2.49271
0.814737
565
31.2
31.57395
-0.37395
-0.12223
464
23.7
26.49443
-2.79443
-0.91335
495
24.5
28.05349
-3.55349
-1.16145
461
30.5
26.34355
4.156449
1.358526
540
25.9
30.31664
-4.41664
-1.44357
588
32.7
32.73068
-0.03068
-0.01003
498
26.9
28.20437
-1.30437
-0.42633
483
24.6
27.44998
-2.84998
-0.93151
554
28.8
31.02074
-2.22074
-0.72584
521
25.9
29.36109
-3.46109
-1.13125
436
24.4
25.08624
-0.68624
-0.2243
398
26.3
23.17514
3.124864
1.021355
366
23.2
21.56578
1.634218
0.534141
439
24.6
25.23712
-0.63712
-0.20824
549
28.8
30.76927
-1.96927
-0.64365
360
19.6
21.26403
-1.66403
-0.54388
566
31.4
31.62424
-0.22424
-0.07329
407
26.6
23.62777
2.972233
0.971468
602
30.6
33.43477
-2.83477
-0.92654
488
27.5
27.70144
-0.20144
-0.06584
526
30.9
29.61255
1.287448
0.4208
524
33.9
29.51197
4.388033
1.434219
562
32.3
31.42307
0.876925
0.286621
496
26.9
28.10378
-1.20378
-0.39345
5
0
-10
-5
model.1$residuals
25
30
35
model.1$fitted.values
h)
Though there is a change in the variance as a function of the fitted values and hence a transformation may help to
stabilize the variance, this plot seems to arguably satisfy the uniform variance assumption.
But, it seems an outlier could be drastically affecting the regressions results.
i)
0
-1
-3
-2
Sample Quantiles
-2
-1
Theoretical Quantiles
j)
There is one obvious outlier. The regression seems to be significantly affected by it. There will be leverage points
after removal. There are a few points in the center which seemingly show a slight violation.
The normality plot seems otherwise satisfied.
kiv)
Call:
lm(formula = VO2_Max ~ Duration)
Residuals:
Min 1Q Median 3Q Max
-9.4342 -1.8962 -0.1962 2.0693 6.5050
Coefficients:
Estimate Std. Error t value Pr(>|t|)
13.3)
why does the data jump from 217 to 301?
Call:
glm(formula = Y ~ X1 + X2 + X3 + X4 + X5, family = "binomial")
Deviance Residuals:
Min
1Q Median
3Q Max
-1.3277 -0.4204 -0.0781 -0.0274 3.2946
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -9.75391 2.54170 -3.838 0.000124 ***
X1
3.67387 1.16481 3.154 0.001610 **
X2
1.21658 0.72822 1.671 0.094798 .
X3
3.35488 0.98210 3.416 0.000635 ***
X4
0.09215 0.03032 3.039 0.002374 **
X5
2.79759 1.16397 2.403 0.016240 *
--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 105.528 on 105 degrees of freedom
Residual deviance: 53.122 on 100 degrees of freedom
AIC: 65.122
Number of Fisher Scoring iterations: 7
a)
included X1 in model as question stated Full model, but did not specify X1s value, so I reported both functions.
if X1 = 0; function is y = -3.60144+ 0.09215 X4
5
4
3
2
1
-2
-1
-3.60144 + 0.09215 * X4
20
40
60
X4
80
20
b)
40
60
X4
80
0.07243 + 0.09215 * X4
7
20
40
60
X4
80
0.2
0.4
0.6
0.8
1.00
0.95
0.90
0.85
20
40
60
80
X4
c)
0.8729791
13.7)
a)
0.05190695
0.02321297
b)
exp(alpha) = odds ratio associated with chol=0, systolic=0.cig=0
exp(B1) = multiplicative change in odds ratio with a one unit change in cholesterol
exp(B2) = multiplicative change in odds ratio with a one unit change in Systolic Blood Pressure
exp(B3) = multiplicative change in odds ratio with a one unit change in Cigarettes
c)
Table of Bij/se(Bij)
Where i goes from one to three representing the respective coefficients and j =1 is the logistic model and j=2 is the
discriminant model..
4.972222222
3.258823529
2.781590763
6.051282051
3.02
3.153282615
All terms seem to be significant.
13.14)
See attached