Stata 15 help for svy postestimation

[SVY] svy postestimation -- Postestimation tools for svy

Postestimation commands

The following postestimation commands are available after svy:

Command Description ------------------------------------------------------------------------- contrast contrasts and ANOVA-style joint tests of estimates estat (svy) postestimation statistics for survey data estimates cataloging estimation results lincom point estimates, standard errors, testing, and inference for linear combinations of coefficients margins marginal means, predictive margins, marginal effects, and average marginal effects marginsplot graph the results from margins (profile plots, interaction plots, etc.) nlcom point estimates, standard errors, testing, and inference for nonlinear combinations of coefficients predict predictions, residuals, influence statistics, and other diagnostic measures predictnl point estimates, standard errors, testing, and inference for generalized predictions pwcompare pairwise comparisons of estimates suest seemingly unrelated estimation test Wald tests of simple and composite linear hypotheses testnl Wald tests of nonlinear hypotheses -------------------------------------------------------------------------

predict after svy

The syntax of predict (and even if predict is allowed) after svy depends on the command used with svy. Specifically, predict is not allowed after svy: mean, svy: proportion, svy: ratio, svy: tabulate, or svy: total.

margins after svy

The syntax of margins (and even if margins is allowed) after svy depends on the command used with svy. Specifically, margins is not allowed after svy: mean, svy: proportion, svy: ratio, svy: tabulate, or svy: total.

Example 1: Linear and nonlinear combinations

. webuse nhanes2 . generate male = (sex == 1) . svy, subpop(male): mean zinc, over(race) . lincom [zinc]White - [zinc]Black

Example 2: Quadratic terms

. webuse nhanes2d, clear . svy: logistic highbp height weight age age2 female . nlcom peak: -_b[age]/(2*_b[age2]) . testnl -_b[age]/(2*_b[age2]) = 70

Example 3: Predictive margins

. webuse nhanes2d . svyset . svy: logistic highbp height weight age c.age#c.age i.female i.race, baselevels . margins race, vce(unconditional) . margins, vce(unconditional) dydx(race) . margins, vce(unconditional) dydx(race) over(region)

Example 4: Nonlinear predictions and their standard errors

. webuse nhanes2d . svy: regress loglead age age2 i.female i.race i.region . predictnl leadhat = exp(xb()), se(leadhat_se) . list lead leadhat leadhat_se age age2 in 1/10, abbrev(10)

Example 5: Multiple-hypothesis testing

. test 2.region 3.region 4.region . test 2.region 3.region 4.region, nosvyadjust . test 2.region 3.region 4.region, mtest(bonferroni)

Example 6: Using suest with survey data

. webuse nhanes2f, clear . svyset psuid [pw=finalwgt], strata(stratid) . svy: ologit health female black age age2 . estimates store H5 . gen health3 = clip(health, 2, 4) . svy: ologit health3 female black age age2 . estimates store H3 . suest H5 H3 . test [H5_health=H3_health3] . test (/H5:cut2=/H3:cut1) (/H5:cut3=/H3:cut2)


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index