Stata 9, Summing up - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

Stata 9, Summing up

Description:

Bivariate. table sex, c(median y) medians. ranksum y, by(sex) equal medians? ... Bivariate. tabulate y sex, col chi2 column %, chisquare. Multivariable ... – PowerPoint PPT presentation

Number of Views:134
Avg rating:3.0/5.0
Slides: 17
Provided by: heins1
Category:

less

Transcript and Presenter's Notes

Title: Stata 9, Summing up


1
Stata 9, Summing up
2
Why Stata
  • Pro
  • Aimed at epidemiology
  • Many methods, growing
  • Graphics
  • Structured, Programable
  • Comming soon to a course near you
  • Con
  • Memorygtfile size
  • Copy table

3
Use
  • Import data
  • DBMS-Copy
  • Do files
  • Highlight commands, Ctrl-D
  • Full syntax
  • by varlist command varlist if exp in
    range , opts
  • list if agelt50
  • list in 1/10
  • regress y x1 x2 if deltabetalt0.3

4
Data check
  • describe describe dataset
  • summarize means
  • list x1 x2 in 1/10 list first 10 obs
  • gen id_n generate id
  • numlabel x1 x2, add add value to label
  • tab x1 x2, mis x1 by x2 including missing
  • list id x1 if (x2.)(x3.)1 list if x1 or
    x2 is missing
  • egen missrowmiss(x1 x2 x3) number missing
  • tab miss from 0-3 missing
  • drop x1 if x1lt0 drop negative
  • drop x1 if x1gt100 x1lt. drop large

5
Graphics
  • Explore data
  • kdensity y distribution
  • scatter y x scatter
  • twoway (scatter y x)(lfit y x) scatterline
  • Plot means
  • graph bar (mean) y1 y2 mean of y1 and y2
  • graph bar (mean) y, over(c) mean y for values of
    c
  • Plot means using aggregate and twoway
  • preserve
  • collapse (mean) ymy, by(c) one line pr c value
  • line ym c lineplot mean(y) by c
  • restore

6
Help
  • General
  • help command
  • search keyword
  • findit keyword
  • Examples
  • help table
  • search GAM
  • findit GAM

7
Continuous symetrical data
  • Univariate
  • kdensity y distribution
  • summarize y means
  • Bivariate
  • sdtest y, by(sex) equal variance?
  • ttest y, by(sex) equal means?
  • oneway y parity3, tabulate equal means?
  • Multivariable
  • regress y x1 x2 linear regression
  • dfbeta

8
Some options
  • mean y meanci
  • mean y, cluster(region)
  • mean y, standardize
  • mean y, bootstrap

9
Continuous skewed data
  • Univariate
  • kdensity y distribution
  • summarize y, detail medians
  • Bivariate
  • table sex, c(median y) medians
  • ranksum y, by(sex) equal medians?
  • table sex, c(median y) medians
  • kwallis y, by(age3) equal medians?
  • Multivariable
  • regress y x1 x2 linear regression
  • dfbeta

10
Categorical data
  • Univariate
  • tabulate y freq table
  • proportion y prop with ci
  • Bivariate
  • tabulate y sex, col chi2 column , chisquare
  • Multivariable
  • logistic y x1 x2 logistic regression
  • binreg y x1 x2, rd risk difference

11
Survival data
  • Set
  • stset time, failure(status1)
  • Univariate
  • sts graph, fail gwood KM failureci
  • Bivariate
  • sts graph, fail by(x1) KM failure
  • sts test x1 log rank test
  • Multivariable
  • stcox x1 x2 cox regression

12
Model building
  • Estimate
  • regress y exp exposure only
  • est store m1 store
  • regress y exp x1 x2 exposure conf.
  • est store m2 store
  • Compare
  • est table m1 m2 confounding?
  • est stat m1 m2 model fit
  • Interaction
  • regress y exp x1 x1exp with interaction term
  • lincom exp2x1exp effect of exp for x12

13
Model testing
  • Assumptions
  • Independent errors discuss
  • Linear effects categorize, plot coefs
  • Constant error plot resid (linear mod)
  • Influence
  • Influential points plot delta-beta

14
  • Regression with simple error structure
  • regress linear regression (also heteroschedastic
    errors)
  • nl non linear least squares
  • GLM
  • logistic logistic regression
  • poisson Poisson regression
  • binreg binary outcome, OR, RR, or RD effect
    measures
  • Conditional logistc
  • clogit for matched case-control data
  • Multiple outcome
  • mlogit multinomial logit (not ordered)
  • ologit ordered logit
  • Regression with complex error structure
  • xtmixed linear mixed models
  • xtlogit random effect logistic

15
GLLAMM
  • Generalized Linear Latent And Mixed Models
  • Response types
  • continuous
  • ordered and unordered categories
  • counts
  • survival
  • Model types
  • Generalized Linear Models (GLM)
  • Structural Equation Models (SEM)
  • Mixed Models
  • Measurement Error models

16
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com