**[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)**