__Title__

**[SVY] svycal** -- Calibration-adjusted sampling weights

__Syntax__

Linear-regression-adjusted sampling weights

**svycal** **regress** *varlist* [*weight*] [*if*] [*in*] **,** __gen__**erate(***newvar***)**
__tot__**als(***spec***)** [__nocons__**tant** **ll(***#***)** **ul(***#***)** __iter__**ate(***#***)** __tol__**erance(***#***)**
**force**]

Raking-ratio-adjusted sampling weights

**svycal** **rake** *varlist* [*weight*] [*if*] [*in*] **,** __gen__**erate(***newvar***)** __tot__**als(**
*spec***)** [__nocons__**tant**]

*varlist* may contain factor variables; see fvvarlist.
**pweight**s and **iweight**s are allowed; see weights.

__Description__

**svycal** generates calibration-adjusted weights for survey data analysis.

**svycal** **regress** generates sampling weights that are adjusted according to
an additive (linear) distance measure.

**svycal** **rake** generates sampling weights that are adjusted according to a
multiplicative distance measure.

__Options__

**generate(***newvar***)** specifies the name of a new variable in which to put the
adjusted sampling weights. **generate()** is required.

**totals(***spec***)** specifies the population totals corresponding to the
variables specified in *varlist*. *spec* is one of

*matname* [**,** **skip** **copy**]

{ [*eqname***:**]*name* **=** *#* | **/***eqname* **=** *#* } [*...*]

*#* [*#* *...*]**,** **copy**

That is, *spec* may be a matrix name, for example, **totals(poptotals)**; a
list of variable names in *varlist* with their population totals, for
example, **totals(_cons=1300 dogs=850 cats=450)**; or a list of values,
for example, **totals(850 450 1300)**.

**skip** specifies that any parameters found in the specified
initialization vector that are not also found in the model be
ignored. The default action is to issue an error message.

**copy** specifies that the list of values or the initialization vector
be copied into the initial-value vector by position rather than
by name.

**noconstant** prevents **svycal** from including an intercept in the calibration
calculations.

**ll(***#***)** specifies a lower limit for the weight ratios.

**ul(***#***)** specifies an upper limit for the weight ratios.

**iterate(***#***)** specifies the maximum number of iterations. When the number
of iterations equals **iterate()**, the calibration adjustment stops and
presents a note. The default is **iterate(1000)**.

**tolerance(***#***)** specifies the tolerance for the Lagrange multiplier in the
calibration equations. Convergence is achieved when the relative
change in the Lagrange multiplier from one iteration to the next is
less than or equal to **tolerance()**. The default is **tolerance(1e-7)**.

**force** prevents **svycal** from exiting with an error if the calibration
adjustment fails to converge.

__Examples__

Poststratification adjustment: population totals in a matrix

**. webuse poststrata**
**. matrix poptotals = 1300, 850, 450**
**. matrix colnames poptotals = _cons 1.type 2.type**
**. svycal regress i.type [pw=weight], generate(adj_weight)**
**totals(poptotals)**

Poststratification adjustment: population totals using key-value pairs

**. webuse poststrata**
**. svycal regress i.type [pw=weight], generate(adj_weight)**
**totals(_cons=1300 1.type=850 2.type=450)**

Poststratification adjustment: population totals using a list of values

**. webuse poststrata**
**. svycal regress i.type [pw=weight], generate(adj_weight) totals(850**
**450 1300, copy)**

__References__

Deville, J.-C., and C.-E. Sarndal. 1992. Calibration estimators in
survey sampling. *Journal of the American Statistical Association* 87:
376-382.

Deville, J.-C., C.-E. Sarndal, and O. Sautory. 1993. Generalized raking
procedures in survey sampling. *Journal of the American Statistical*
*Association* 88: 1013-1020.

Valliant, R. 2002. Variance estimation for the general regression
estimator. *Survey* *Methodology* 28: 103-114.