Q1. Say, you are exploring the relationship between A (a binary treatment variable) and Y (a continuous outcome variable), adjusting for confounders. From the literature, two confounders L1 and L2 are identified. Which code could be used to run the regression analysis in R? (select ALL that apply)
- A. mod1 <- glm(Y ~ A, family = 'gaussian', data = mydata)
- B. mod1 <- glm(Y ~ A, family = 'binomial', data = mydata)
- C. mod1 <- glm(Y ~ A + L1 + L2, family = 'binomial', data = mydata)
- D. mod1 <- glm(Y ~ A + L1 + L2, family = 'gaussian', data = mydata)
- E. mod1 <- glm(Y ~ A + L1 + L2, data = mydata)
- F. mod1 <- lm(Y ~ A + L1 + L2, data = mydata)
Q2. In Q1, a mediator (M1) is also identified from the literature. Which code could be used to run the regression analysis in R to estimate the total effect of A on Y?
- A. mod2 <- glm(Y ~ A + L1 + L2, family = 'binomial', data = mydata)
- B. mod2 <- glm(Y ~ A + L1 + L2 + M1, family = 'binomial', data = mydata
- C. mod2 <- glm(Y ~ A + L1 + L2 + M1, family = 'gaussian', data = mydata)
- D. mod2 <- glm(Y ~ A + L1 + L2, family = 'gaussian', data = mydata)
- E. mod2 <- lm(Y ~ A + L1 + L2 + M1, data = mydata)
Two important notes here: (i) the family argument and (ii) whether or not adjusting for mediators in the model when estimating the total effect of a treatment.
Q3. In Q2, say, M1 is actually a collider than a mediator. How could you fit the model in this case?
- A. mod3 <- glm(Y ~ A + L1 + L2, family = 'binomial', data = mydata)
- B. mod3 <- glm(Y ~ A + L1 + L2, family = 'gaussian', data = mydata)
- C. mod3 <- glm(Y ~ A + L1 + L2 + M1, family = 'binomial', data = mydata
- D. mod3 <- lm(Y ~ A + L1 + L2 + M1, data = mydata)
- E. mod3 <- glm(Y ~ A + L1 + L2 + M1, family = 'gaussian', data = mydata)
Two important notes for this question as well: (i) the family argument and (ii) whether or not adjusting for colliders in the model.
Q4. In Q2, say, M1 is an instrumental variable. How could you fit the model when aiming to estimate the effect of A on Y?
- A. mod4 <- glm(Y ~ M1, family = 'binomial', data = mydata)
- B. mod4 <- glm(Y ~ A + M1, family = 'binomial', data = mydata
- C. mod4 <- glm(Y ~ A + M1, family = 'gaussian', data = mydata)
- D. mod4 <- lm(Y ~ A + M1, data = mydata)
- E. mod4 <- lm(Y ~ A + L1 + L2 + M1, data = mydata)
- F. mod4 <- glm(Y ~ A + L1 + L2, family = 'gaussian', data = mydata)
- G. mod4 <- glm(Y ~ A + L1 + L2 + M1, family = 'gaussian', data = mydata)
Two important notes for this question as well: (i) the family argument and (ii) whether or not adjusting for instrumental variables in the model.