------------------------------------------------------------------------------- help for variancemat -------------------------------------------------------------------------------

Generate a matrix of variances

variancemat varlist [if exp] [in range] [weight], matname(matrix) [common]

Description

variancemat generates an n by 1 matrix of the variances of the variables in varlist.

The rownames of matrix will be the variable names in varlist; the colname of column 1 will be "variance".

aweights, iweights, and fweights are allowed; aweight is the default.

Required Options

matname(matrix) specifies the name of the matrix to be created. If matrix already exists as a scalar or matrix, it will be overwritten.

Optional Options

common specifies that the variances are to be calculated on the common set of observations that are nonmissing for all variables in varlist. The default is for variances to be calculated for each variable independently. In either case, the variance calculations are additionally restricted by any [if exp] or [in range] conditions that may be present.

Examples

. variancemat age income numkids, matname(m)

. variancemat age income numkids, matname(m) common

. variancemat age income numkids if numkids>0, matname(m)

. variancemat age income numkids [aw= wgt1], matname(m)

Remarks

variancemat was written for use by an earlier version of mahapick, but has been superseded by covariancemat in that application. It may be of use in other circumstances.

Author David Kantor; initial development was done at The Institute for Policy Studies, Johns Hopkins University. Email kantor.d@att.net if you observe any problems.

Also See covariancemat, mahapick, mahascore, mahascores, mahascore2,