__Title__

**[SVY] svygen** -- Generating adjusted sampling weights

__Syntax__

Poststratification adjusted sampling weights

**svygen** __post__**stratify** *new_weight_var* [*weight*] [*if*] [*in*] [**,**
__posts__**trata(***varname***)** __postw__**eight(***varname***)** **nocheck**]

Balanced repeated replicate (BRR) weights

**svygen** __br__**r** *stub* [*weight*] [*if*] [*in*]**,** __H__**adamard(***matname***)** __str__**ata(***varname***)**
[**psu(***varname***)** **fay(***#***)** __posts__**trata(***varname***)** __postw__**eight(***varname***)**
**nocheck**]

Jackknife replicate weights

**svygen** __jack__**knife** *stub* [*multiplier*] [*weight*] [*if*] [*in*] [**,**
__str__**ata(***varname***)** **psu(***varname***)** **fpc(***varname***)** __posts__**trata(***varname***)**
__postw__**eight(***varname***)**]

Successive difference replicate (SDR) weights

**svygen** **sdr** *stub* [*weight*] [*if*] [*in*]**,** __H__**adamard(***matname***)** [**psu(***varname***)**
__posts__**trata(***varname***)** __postw__**eight(***varname***)** **nocheck**]

**pweight**s and **iweight**s are allowed; see weights.

__Description__

**svygen** generates adjusted weights for survey data analysis.

**svygen** **poststratify** generates sampling weights that are adjusted
according to the poststratification weights.

**svygen** **brr** generates BRR weights for designs with two primary sampling
units per stratum.

**svygen** **jackknife** generates delete-1 jackknife replicate weights.

**svygen** **sdr** generates SDR weights.

__Options__

**poststrata(***varname***)** specifies the name of a variable (numeric or string)
that identifies the poststratum groups.

**postweight(***varname***)** specifies the name of a numeric variable that
contains the poststratum counts in the population.

**nocheck** prevents **svygen** **poststratify** from checking the validity of the
poststratum counts. This option helps speed things up when **svygen** is
called within a loop, but it should only be used once the counts have
been validated.

**hadamard(***matname***)** (**brr** and **sdr** only) specifies the name of a Hadamard
matrix. The Hadamard matrix *matname* is a square matrix *H* with *k*
columns, such that *HH*' = *k***I(***k***)**, where **I(***k***)** denotes the identity
matrix with *k* columns.

For **svygen** **brr**, *k* must be larger than or equal to the number of
strata identified in the **strata()** option.

For **svygen** **sdr**, *k* must be larger than or equal to the number of
primary sampling units (PSUs).

**fay(***#***)** (**brr** only) specifies Fay's adjustment. The sampling weights of
the selected PSUs for a given replicate are multiplied by **2-***#*, while
the sampling weights for the unselected PSUs are multiplied by *#*.
**fay(0)** is the default and is equivalent to the original BRR method.

*#* must be a number between 0 and 2; however, **fay(1)** is not allowed.

**strata(***varname***)** (**brr** and **jackknife** only) specifies the name of a variable
(numeric or string) that contains stratum identifiers. **strata()** is
required by **brr**.

**psu(***varname***)** (**brr** and **jackknife** only) specifies the name of a variable
(numeric or string) that contains identifiers for the PSUs
(clusters).

**fpc(***varname***)** (**brr** and **jackknife** only) specifies the name of a numeric
variable that contains finite population corrections for the variance
estimates.

__Examples__

**. svygen brr brrw [pw=sampwgt], H(h12) strata(strid) psu(psuid)**
**. svygen jackknife f jkw [pw=sampwgt], strata(strid) psu(psuid)**
**. svygen sdr sdrw [pw=sampwgt], psu(psuid)**
**. svygen post pwgt [pw=sampwgt], posts(strid postid) postw(totals)**