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. For which two models you would use a LRT to compare (i.e. nested models? (More than one correct answers)
a. a logistic regression model predicts Alzheimer’s diagnosis using a scale of memory impairment
b. a logistic regression model predicts Alzheimer’s diagnosis using a scale of memory impairment and a scale of changes in personality
c. a logistic regression model predicts Alzheimer’s diagnosis using a scale of memory impairment scale, a scale of cognitive skills, and age
d. null model of Alzheimer’s diagnostics
Q3. What is the link function used in logistic regression?
a. log function
b. logit function
c. logistic function
Q4. What is the yhat that we want to model in logistic regression?
a. probability that outcome=1
b. odds that outcome=1
c. log odds that outcome=1
Q5. What is the yhat that we would get if we do not specify descending option in PROC LOGISTIC?
a. probability that outcome=1
b. odds that outcome=1
c. probability that outcome=0
Q7. 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
Q8. 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)?
Q9. 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;
Demonstrate calculation in class😄
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;
Measures of Association
Logistic regression: generating plots
Firth Regression in PROC LOGISTIC
Logistic regression details - Pt1
Logistic regression in R