------------------------------------------------------------------------------- help forbrrtab-------------------------------------------------------------------------------

Two-way tables for survey data, with balance repeated replication (BRR) based s> tandard errors

brrtabvarname1varname2[weight] [ifexp] [inrange] [,[survey design options]

brrweight(varlist)fay(#)dof(#)[tabulate options]

tab(varname)missing[display items]

cellcountrowcolumnobssecideffdeft[display options]

[

proportion|percent]nolabelnomarginalsformat(%fmt)verticallevel(#)[statistic options]

pearsonlrnullwaldllwaldnoadjust]

pweights are allowed; see help weights. They may be specified with the command, or by the svyset pweight command.A set of replicate weights are required. They may be specified through the

brrweightoption; they need not be respecified for subsequent brr-based commands.

brrtabtyped without arguments redisplays previous results. Any of the "display items", "display options", or "statistic options" can be specified when redisplaying with the following exception:waldmust be specified at run time.

Description

brrmodelproduces two-way tabulations with tests for independence for complex survey data. The method of balanced repeated replication (BRR) is used, in conjunction with a set of user-specified replicate weights, to estimate (co)variances of estimates. This is an alternate method to the Taylor series linearization methods used by Stata's svy-based commands.Except for the different method of variance calculation,

brrtabhas identical syntax as svytab. Point estimates are the same as those from svytab; standard errors and tests of independence are different.{strong}This is a beta test version of the command. As far as I know, everything works as it should, but use at your own risk. Currently, finite population correction factors (FPC) are not supported.

Options unique to brrweight

brrweight()specifies the list of variables that contain the replicate weights for the dataset. The standard errors for the model are based on the variation in the estimates generated across the various weights.A set of

brrweightsis required for the analysis. Once the brrweights are specified they are stored as a characteristic of the dataset and need not be respecified in subsequent commands.

fay()specifies the k value that should be used for weighting the estimates, based on Fay's method. The default is zero, meaning that simple averaging will be used. As with the replicate weights, the value for fay() is stored as a characteristic of the dataset once it is specified, and need not be re-specified in subsequent commands.

dof()specifies the degrees of freedom for the analysis. By default, it is equal to the number of replications.

Examples. brrtab agegrp gender [pw=wgt] , brrw(brrw*) . brrtab, se ci deff [redisplay std. err., etc.] . brrtab, count column obs [redisplay counts, etc.]

. brrtab agegrp gender, count se [compute std. err. of counts] . brrtab, count ci [redisplay CI of counts]

. brrtab agegrp gender, wald [compute Wald test] . brrtab, pearson lr [redisplay

pearsonandlrtests]. brrtab agegrp gender, tab(income) [gives income proportions by

agegrpandgender]

Saved Results

brrtabgenerates the same saved results assvytab.Note that e(cmd) is set to "svytab" in order to allow post-tabulation tests to > function correctly.

Methods and formulaePoint estimates are calculated using aweights, and are identical to those produced by Stata's svytab. The (co)variance matrix of the estimates is formed by calculating

G V = c * SUM [ (B - B(i))(B - B(i))' ] i=1

where B a vector of the estimated cell contents based on the full sample weights, B(i) is the estimated vector using the i'th set of replicate weights, G is the number of replicates, and c is a constant defined as:

1 / G for standard BRR (i.e. fay==0), or

1 / (G*(1-k)^2) for Fay's method.

Acknowledgements

brrtabconsists largely of the ado file code from official Stata'ssvytabcommand, version 1.1.6, modified to calculate (co)variances differently. I would like to thank Bobby Gutierrez at StataCorp for advice on implementation of BRR.

AuthorNick Winter Cornell University nw53@cornell.edu