Learn R Programming

simPop (version 0.2.9)

calibVars: Construct a matrix of binary variables for calibration

Description

Construct a matrix of binary variables for calibration of sample weights according to known marginal population totals.

Usage

calibVars(x)

Arguments

x
a vector that can be interpreted as factor, or a matrix or data.frame consisting of such variables.

Value

  • A matrix of binary variables that indicate membership to the corresponding factor levels.

See Also

calibSample

Examples

Run this code
data(eusilcS)
# default method
aux <- calibVars(eusilcS$rb090)
head(aux)
# data.frame method
aux <- calibVars(eusilcS[, c("db040", "rb090")])
head(aux)

Run the code above in your browser using DataLab