lin.ratio: Linearization of the ratio estimator

Description Usage Arguments Value References See Also Examples

Description

Computes linearized variable for the ratio estimator.

Usage

1
lin.ratio(Y, Z, weight, Dom = NULL, dataset = NULL, percentratio = 1, checking = TRUE)

Arguments

Y

Matrix of numerator variables. Any object convertible to data.table with numeric values, NA values are not allowed.

Z

Matrix of denominator variables. Any object convertible to data.table with numeric values, NA values are not allowed.

weight

Weight variable. One dimensional object convertible to one-column data.table.

Dom

Optional variables used to define population domains. If supplied, the linearized variables are computed for each domain. An object convertible to data.table.

dataset

Optional survey data object convertible to data.table.

percentratio

Positive integer value. All linearized variables are multiplied with percentratio value, by default - 1.

checking

Optional variable if this variable is TRUE, then function checks data preparation errors, otherwise not checked. This variable by default is TRUE.

Value

The function returns the data.table of the linearized variables for the ratio estimator.

References

Carl-Erik Sarndal, Bengt Swensson, Jan Wretman. Model Assisted Survey Sampling. Springer-Verlag, 1992, p.178.

See Also

domain, vardom, vardomh, vardcros, vardchanges, vardannual

Examples

1
2
3
4
5
6
7
Y <- data.table(Y = rchisq(10, 3))
Z <- data.table(Z = rchisq(10, 3))
weights <- rep(2, 10)
data.table(Y, Z, weights, 
           V1 = lin.ratio(Y, Z, weights, percentratio = 1),
           V10 = lin.ratio(Y, Z, weights, percentratio = 10),
           V100 = lin.ratio(Y, Z, weights, percentratio = 100))


Search within the vardpoor package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.