Presentation is loading. Please wait.

Presentation is loading. Please wait.

Discussion: Week 4 Phillip Keung.

Similar presentations


Presentation on theme: "Discussion: Week 4 Phillip Keung."β€” Presentation transcript:

1 Discussion: Week 4 Phillip Keung

2 Outline Logistic regression and the HIVNET dataset
2x2 tables vs logistic regression Effect modifiers in logistic regression Presence of confounding Other forms of binary regression And associated computational issues Note on mhodds

3 Logistic Regression logistic will6 c.know6 will0 know0 i.group i.educ cohort age, coef Syntax: c.varname i.varname coef estimates store base Need to save estimates for LR test later

4 OR Estimate The odds of being willing to participate in a vaccine trial is times the odds of being willing to participate for two groups that have knowledge scores that differ by one point given the two groups being compared are from the same cohort, are the same age, have the same education level, risk group, and have the same baseline knowledge and willingness scores.

5 Aside: Tables vs Regression
Logistic regression is helpful when: Adjusting for lots of covariates Adjusting for continuous covariates Data is sparse Let’s look at the OR of willingness and dichotomized education level (i.e. the school variable) using tables and logistic regression

6 Aside: Tables vs Regression
egen five_age = cut(age), group(5) Convert age to a discrete variable with 5 groups of roughly equal size mhodds will6 school, by(five_age) OR: 0.811 logistic will6 school i.five_age OR: 0.809 logistic will6 school age OR: 0.796

7 Aside: Tables vs Regression
Notice that (with 5 age groups) the logistic regression and the M-H adjusted OR are very close Choice of number of categories arbitrary, and could leave residual confounding Logistic regression allows more flexibility for modeling the relationship between age and willingness

8 Education Interaction
logistic will6 c.know6##i.educ will0 know0 i.group cohort age, coef Syntax: ## estimates store educ_inter Store estimates from regression lrtest base educ_inter Compare base model to model with education interaction term using LR test

9 Effect Modification Base model:
will6 | Coef. Std. Err z P>|z| [95% Conf. Interval] know6 | will0 | know0 | | group | 2 | 3 | 4 | educ | 2 | 3 | 4 | 5 | 6 | cohort | age | _cons |

10 Effect Modification New model:
will6 | Coef. Std. Err z P>|z| [95% Conf. Interval] know6 | | educ | 2 | 3 | 4 | 5 | 6 | educ#c.know6 | 2 | 3 | 4 | 5 | 6 | will0 | know0 | group | 2 | 3 | 4 | cohort | age | _cons |

11 LR Test Can only be used to compare nested models
The base model is a sub-model of the new model P-value of 0.66, so no evidence of interaction between education level and knowledge score at month 6

12 Group Interaction logistic will6 c.know6##i.group will0 know0 i.educ cohort age, coef estimates store group_inter lrtest base group_inter

13 Confounding Look at how the OR between willingness and knowledge changes with and without the possible confounder No statistical test for confounding Rules of thumb exist E.g % change in coefficient Not recommended Should have a scientific reason to declare a covariate a confounder though

14 Confounding Base model
Log-OR: logistic will6 c.know6 will0 know0 i.group cohort age, coef Log-OR: logistic will6 c.know6 will0 know0 i.educ cohort age, coef Log-OR: logistic will6 c.know6 will0 know0 i.group i.educ age, coef Log-OR: logistic will6 c.know6 will0 know0 i.group i.educ cohort, coef Log-OR:

15 RR/RD Regression Use binreg to get RR/RD estimates
binreg will6 c.know6 cohort, coef rr RR: 0.973 binreg will6 c.know6 cohort, rd RD:

16 RR/RD Regression What do the models look like? For RR: For RD:
log 𝑝 = 𝛽 0 + 𝛽 1 π‘˜π‘›π‘œπ‘€6+ 𝛽 2 π‘π‘œβ„Žπ‘œπ‘Ÿπ‘‘ For RD: 𝑝= 𝛽 0 + 𝛽 1 π‘˜π‘›π‘œπ‘€6+ 𝛽 2 π‘π‘œβ„Žπ‘œπ‘Ÿπ‘‘ Interpretation of coefficients/output?

17 RR/RD Regression RR: The likelihood of being willing to participate in vaccine trials is times the likelihood of being willing to participate for two groups that have knowledge scores that differ by one point given that the groups are from the same cohort.

18 RR/RD Regression RD: There would be 6.2 fewer people for every 1000 who would be willing to participate in vaccine trials in a group with a knowledge score that was one point higher than another group given that both groups were from the same cohort.

19 Aside: Computational Issues
We encountered no problems when running the full model with logistic regression Try: binreg will6 c.know6 will0 know0 i.group i.educ cohort age, rr binreg will6 c.know6 will0 know0 i.group i.educ cohort age, rd After > 600 iterations (for the RD), the model will not have converged

20 Aside: Computational Issues
Why? Reasons are technical, but loosely speaking, it has to do with the fact that the estimated probabilities should lie between 0 and 1 It’s not easy to force the estimates to remain inside that sensible range unless you use the log-odds

21 RR/RD Vs OR Pros for OR: Cons for OR:
Works when you have case-control data Is approximately the RR for rare events Logistic regression implemented in most statistical software packages Cons for OR: OR is not necessarily the right measure of association Also, OR arguably harder to interpret OR has strange properties (look up non-collapsibility if you’re interested)

22 RR/RD vs OR Pros for RR/RD: Cons for RR/RD:
RR or RD is often the actual measure of association that you’re interested in Cons for RR/RD: RR/RD regression is numerically unstable (i.e. the model won’t converge) Not applicable to case-control data Not necessarily available in every software package

23 Aside: mhodds Word of warning about continuous covariates and mhodds:
It does something like logistic regression when you give it a variable that seems continuous . mhodds will6 age Score test for trend of odds with age (The Odds Ratio estimate is an approximation to the odds ratio for a one unit increase in age) Odds Ratio chi2(1) P>chi [95% Conf. Interval]

24 Aside: mhodds . logistic will6 age, iter(1) convergence not achieved Logistic regression Number of obs = LR chi2(1) = Prob > chi2 = Log likelihood = Pseudo R = will6 | Odds Ratio Std. Err z P>|z| [95% Conf. Interval] age | Warning: convergence not achieved Answers are slightly different for technical reasons which are uninteresting

25 Questions?


Download ppt "Discussion: Week 4 Phillip Keung."

Similar presentations


Ads by Google