Learn R Programming

synthpop (version 1.3-1)

syn.nested: Synthesis for a variable nested within another variable.

Description

Synthesizes one variable (y) from another one (x) when y is nested in the categories of x. A bootstrap sample is created from the original values of y within each category of xp (the syntheisied values of the grouping variable).

Usage

syn.nested(y, x, xp, ...)

Arguments

y

an original data vector of length n for the nested variable.

x

an original data vector of length n for the variable within which y is nested.

xp

a vector of length k with synthetic values of x.

additional parameters.

Value

A vector of length k with synthetic values of y.

Details

An example would be when x is a detailed classification of occupations and y is more detailed sub-classification. It is intended that both x and y are categorical (factor) variables. A warning will be issued if the original y is not nested within x.