poll (10 mins) + answers
Q1. For which outcome variable(s) you would prefer logistic regression over linear regression?
a. individual daily consumption of vegetables (unit: serving)
b. parental depressive symptoms, measured by a validated 9-item scale
c. youth vaping experience (have vaped vs never vaped)
Q2. Which residual assumptions are violated for binary outcome?
a. normality
b. independence
c. homoscedasticity
Q3. What is the function used in logistic regression?
a. log function
b. logit function
c. logistic function
Q4. What is the yhat that we are modeling in logistic regression?
a. probability that outcome=1
b. odds that outcome=1
c. log odds that outcome=1
Q5. What is the equivalent term of partial regression coefficients (MLR) in a logistic regression model?
a. odds
b. crude/unadjusted odds ratio
c. adjusted odds ratio
d. relative odds
Q6. If the probability that a UNC undergraduate ever studied abroad is p=0.25, what are the odds of no study abroad experience (vs study abroad experience)?
Q7. For a predictor in a logistic regression, if its point estimate is 0.80 and SE is 0.33, what are the OR and 95%CI?
a. OR=0.80, 95%CI=0.15,1.45
b. OR=2.23, 95%CI=1.58,2.88
c. OR=2.23, 95%CI=1.16,4.26
proc freq data=heart;
tables hd*sex/OR; *OR output the odds ratio;
format hd hd_f.
sex sex_f.;
run;
proc univariate;
var age trestbps chol;
run;
proc sgplot data=heart;
title "boxplot of age by heart disease diagnosis";
vbox age/ group = hd;
yaxis label = "age";
format hd hd_f.;
run;
title; *reset title;
proc sgplot data=heart;
title "boxplot of resting blood pressure by heart disease diagnosis";
vbox trestbps/ group = hd;
yaxis label = "resting blood pressure";
format hd hd_f.;
run;
proc sgplot data=heart;
title "boxplot of cholestoral by heart disease diagnosis";
vbox chol / group = hd;
yaxis label = "serum cholestoral";
format hd hd_f.;
run;
proc logistic data=heart descending; /*need "descending" to model hd=1*/
title "logistic regression of heart disease";
model hd=sex;
run; quit;
/*or specify event as 1*/
proc logistic data=heart;
title "logistic regression of heart disease";
model hd (event="1")=sex;
run; quit;
proc logistic data=heart;
model hd (event="1")=sex age chol trestbps;
run;quit;
proc logistic data=heart descending;
model hd=sex age chol trestbps;
estimate "log odds of hd=1 (female, 55 yrs, chol= 140, trestbps= 270)" sex 0 age 55 chol 140 trestbps 270;
estimate "log odds of hd=1 (male, 55 yrs, chol= 140, trestbps= 270)" sex 1 age 55 chol 140 trestbps 270;
run;quit;