Professional Documents
Culture Documents
Where’s my data?
Descriptive statistics
/* Histograms */
hist varname
/* Interested in normality of your data? You can tell
Stata to draw the normal curve over your histogram*/
hist varname, normal
/* scatterplots */
twoway (scatter var1 var2)
graph matrix var1 var2
var3
/* tabulate happy separately for men and women */ bysort sex: tab
/* not all commands can be used with the by prefix. some, (like h
hist happy, by(sex)
Labels
You never know why and when your data may be reviewed
ALWAYS label every variable no matter how insignificant it may seem
Stata uses two sets of labels: variable labels and value labels
Variable labels are very easy to use – value labels are a little more complicate
= = equal to
= used in assigning values
! = not equal to
> greater than
> = greater than or equal to
& and
| or
Recoding variables
Deleting variables