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

Title

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

Syntax

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

Description

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

Options

replace is required because will be replacing any existing file

over( ) one variable specifying subpopulations

category( ) two cateogires of subpopulations, see examples below

svy specify survey means

vce(vcetype) vcetype may be bootstrap or jackknife

cluster(varname) adjust standard errors for intragroup correlation

excel specifies excel output

word specifies word output

tex specifies tex output

Remarks

mean2 is 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.

Acknowledgement

sxpose 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 see

Manual: [R] mean