a) Let's run the following code in R to graph the probability of MI for smokers and non-smokers separately:
Code:
X2 = seq(from=0,to=550,by=1)
p1 = -2.2791 + 0.7682*1 + 0.001952*(X2-100)
p2 = -2.2791 + 0.7682*0 + 0.001952*(X2-100)
py.s = exp(p1)/(1+exp(p1))
py.ns = exp(p2)/(1+exp(p2))
plot(x=X2,y=py.s)
plot(x=X2,y=py.ns)
Output:
For Smokers:
Non smokers:
b) We have to assume the sample size as we don't know the value. Let's take N = 100
Coefficient | Standard Error | t | p-value | |
Smoking | 0.7682 | 0.3137 | 2.448836468 | 0.016 |
Serum | 0.001952 | 0.001608 | 1.213930348 | 0.229 |
Hence, the smoking variable is significant here and not the serum triglyceride variable.
Confidence bands for the Exercise yocardial infarc 13.8 In a paper in American Statistician, Hauc...
3. A researcher collected data to study the effect of smoking on the risk of a heart attack. The variables were x - a categorical variable with the categories: (1) Present smoker (2) Past smoker (smoked but quit) (3) Non-smoker Y - a binary variable defined by: Y 1 if the person had a heart attack Y-0 if the person didn't have a heart attack Since the X-variables are categorical, the researcher coded the X-variable by two dummy variables: X2...