basic epidemiologic analysis with stata part ii biostatistics 212 lecture 6

19
Basic epidemiologic analysis with Stata Part II Biostatistics 212 Lecture 6

Upload: evelyn-sanders

Post on 01-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Basic epidemiologic analysis with Stata Part II Biostatistics 212 Lecture 6

Basic epidemiologic analysis with Stata

Part II

Biostatistics 212

Lecture 6

Page 2: Basic epidemiologic analysis with Stata Part II Biostatistics 212 Lecture 6

Housekeeping

• Questions on Lab 3, Excel

• Extra credit puzzler

• Lab 4 – last Lab before Final Project– Due November 8th

– Email DO file to Scott at [email protected]

• Final project– Due December 6th

Page 3: Basic epidemiologic analysis with Stata Part II Biostatistics 212 Lecture 6

Today...

• Adjusting for many things at once

• Logistic regression

• Testing for trends

• Extra time for Lab 4?

Page 4: Basic epidemiologic analysis with Stata Part II Biostatistics 212 Lecture 6

Last time

• Binge drinking appears to be associated with coronary calcium– Association partially due to confounding by

gender

• What about race? Age? SES? Smoking?

Page 5: Basic epidemiologic analysis with Stata Part II Biostatistics 212 Lecture 6

Multivariable adjustmentmanual stratification

# 2x2 tables

Crude association 1

Adjust for gender 2

Adjust for gender, race 4

Adjust for gender, race, age 68

Adjust for “” + income, education 816

Adjust for “” + “” + smoking 2448

Page 6: Basic epidemiologic analysis with Stata Part II Biostatistics 212 Lecture 6

Multivariable adjustmentcs command

• cs command– Does manual stratification for you

• Lists results from every strata

• Tests for overall homogeneity

• Adjusted and crude results

– Demo cs cac binge, by(male black age)

Page 7: Basic epidemiologic analysis with Stata Part II Biostatistics 212 Lecture 6

Multivariable adjustmentcs command

• cs command– Does manual stratification for you

• Lists results from every strata

• Tests for overall homogeneity

• Adjusted and crude results

– Demo cs cac binge, by(male black age)– Can’t interpret interactions!

Page 8: Basic epidemiologic analysis with Stata Part II Biostatistics 212 Lecture 6

Multivariable adjustmentmhodds command

• mhodds allows you to look at specific interactions, adjusted for multiple covariates– Does same stratification for you– Adjusted results for each interaction variable– P-value for specific interaction (homogeneity)– Summary adjusted result

• Demo mhodds cac binge age, by(racegender)

Page 9: Basic epidemiologic analysis with Stata Part II Biostatistics 212 Lecture 6

Multivariable adjustmentmhodds command

• mhodds allows you to look at specific interactions, adjusted for multiple covariates– Does same stratification for you– Adjusted results for each interaction variable– P-value for specific interaction (homogeneity)– Summary adjusted result

• Demo mhodds cac binge age, by(racegender)

• But strata get so thin!

Page 10: Basic epidemiologic analysis with Stata Part II Biostatistics 212 Lecture 6

Multivariable adjustmentlogistic command

• Assumes logit model– Await biostats class for details!– Coefficients estimated, no actual stratification– Continuous variables used as they are

Page 11: Basic epidemiologic analysis with Stata Part II Biostatistics 212 Lecture 6

Multivariable adjustmentlogistic command

Basic syntax:

logistic outcomevar [predictorvar1 predictorvar2 predictorvar3…]

Page 12: Basic epidemiologic analysis with Stata Part II Biostatistics 212 Lecture 6

Multivariable adjustmentlogistic command

If using any categorical predictors:

xi: logistic outcomevar [i.catvar var2…]

Creates “dummy variables” on the fly

If you forget, Stata won’t know they are categorical,

and you’ll get the wrong answer!

Page 13: Basic epidemiologic analysis with Stata Part II Biostatistics 212 Lecture 6

Multivariable adjustmentlogistic command

Demo

logistic cac binge

logistic cac binge male

logistic cac binge male black

logistic cac binge male black age

xi: logistic cac binge male black age i.smoke

Page 14: Basic epidemiologic analysis with Stata Part II Biostatistics 212 Lecture 6

Multivariable adjustmentlogistic command

• Pro’s– Provides all OR’s in the model

– Accepted approach

– Can deal with continuous variables

– Better estimation for large models?

• Con’s– Interaction testing more cumbersome, less automatic

– More assumptions

– Harder to test for trends

Page 15: Basic epidemiologic analysis with Stata Part II Biostatistics 212 Lecture 6

Testing for trend

• Alcohol consumption can be a lot or a little– Does association increase with larger amounts

of consumption?– (no j-shaped curve)

• Test of trend?– Look through epitab suite

Page 16: Basic epidemiologic analysis with Stata Part II Biostatistics 212 Lecture 6

Testing for trendstabodds command

• chi2 test of trend– tabodds cac alccat– Look at output

• Adjustment for multiple variables possible– tabodds cac alccat, adjust(age male black)

Page 17: Basic epidemiologic analysis with Stata Part II Biostatistics 212 Lecture 6

Approaching your analysis

• Number of potential models/analyses is daunting– Where do you start? How do you finish?

• My suggestion– Explore

– Plan definitive analysis, make dummy tables/figures

– Do analysis (do/log files), fill in tables/figures

– Show to collaborators, reiterate prn

– Write paper

Page 18: Basic epidemiologic analysis with Stata Part II Biostatistics 212 Lecture 6

Summary

• Epitab commands are a great way to explore your data– Emphasis on interaction

• Logistic regression is a more general approach, ubiquitous, but testing for interactions and trends is more difficult…

Page 19: Basic epidemiologic analysis with Stata Part II Biostatistics 212 Lecture 6

Reminder

• Bring your dataset (cleaned) in two weeks!