filmov
tv
Introductory Stata 17: Mean Comparison (ttest)
Показать описание
The mean of a variable is an important statistic. We often compare the variable means between different groups, such as whether the average wage of male workers is statistically different from that of female workers. In this video, we will explore how to do it in Stata.
*******************
*17. Mean Testing *
*******************
capture log close
describe
summarize
*Test whether the mean of wage is different from 7
summarize wage
ttest wage=7
*Test whether the mean of wage differs by marital status
tabulate married
tabulate married, nolabel
bysort married: summarize(wage)
ttest wage, by(married)
ttest wage, by(union)
*Graph wage means by categorical variables
grmeanby married union, summarize(wage)
log close
#ttest #grmeanby #Stata
*******************
*17. Mean Testing *
*******************
capture log close
describe
summarize
*Test whether the mean of wage is different from 7
summarize wage
ttest wage=7
*Test whether the mean of wage differs by marital status
tabulate married
tabulate married, nolabel
bysort married: summarize(wage)
ttest wage, by(married)
ttest wage, by(union)
*Graph wage means by categorical variables
grmeanby married union, summarize(wage)
log close
#ttest #grmeanby #Stata