total_estimation: Estimates the population totals

Description Usage Arguments Value Examples

View source: R/NonProbEst.R

Description

Estimates the population totals for the specified variables measured in a sample given some pre-calculated weights.

Usage

1
total_estimation(sample, weights, estimated_vars, N)

Arguments

sample

A data frame containing the sample with the variables for which the estimated population totals are to be calculated.

weights

A vector of pre-calculated weights.

estimated_vars

String vector specifying the variables in the sample to be estimated.

N

An integer specifying the population size.

Value

A vector with the corresponding estimations.

Examples

1
2
3
4
covariates = c("education_primaria", "education_secundaria")
data_propensities = propensities(sampleNP, sampleP, covariates)
psa_weights = sc_weights(data_propensities$convenience)
total_estimation(sampleNP, psa_weights, c("vote_pens"), 50000)

Example output

Loading required package: lattice
Loading required package: ggplot2
vote_pens 
 17648.62 

NonProbEst documentation built on July 1, 2020, 6:08 p.m.