help mean2-------------------------------------------------------------------------------

Title

mean2-- Makes a table of estimate means with subpopulation differences

Syntax

mean2[if] [in] [weight],options

Description

mean2provides a fast and easy way to make a table of estimate means with subpopulation differences.

Options

replaceis required because will be replacing any existing file

over( )one variable specifying subpopulations

category()two cateogires of subpopulations, see examples below

svyspecify survey means

vce(vcetype)vcetypemay bebootstraporjackknife

cluster(varname)adjust standard errors for intragroup correlation

excelspecifies excel output

wordspecifies word output

texspecifies tex output

Remarks

mean2is based on mean. You will also need to install the latest versions of outreg2 and sxpose from ssc. There must be at least two variables specified in the varlist.

Acknowledgementsxpose is by Nick Cox.

Examples for Version 11 or later. use http://www.stata-press.com/data/r11/nhanes2f . svyset psuid [pweight=finalwgt], strata(stratid) . mean2 height age weight smsa using myfile.txt, over(sex) cat(Male Female) svy excel replace

Basically the above codes produces the same stuff as this: . svy: mean height age weight smsa, over(sex)

Plus the statistical differences computed by something like this: . lincom [height]Male - [height]Female

You get the idea.

Examples for Version 9 or later. clear . use http://www.stata-press.com/data/r9/nhanes2f . mean2 height age weight smsa using myfile.txt, over(sex) cat(Male Female) svy excel replace

Also seeManual:

[R] mean