getWeights: Return weights calculated using raking algorism

Description Usage Arguments Value

View source: R/getWeights.R

Description

This function takes in a dataframe of individual survey data, each row represents an individual. a dataframe of census constrain data and perform raking algorism to get the weights for each individual based on the census constrain

Usage

1
getWeights(inds, cons, feat, tols = 0.0115)

Arguments

inds

a dataframe of individual survey data, in the form of indicator matrix, each row represent an individual

cons

a dataframe of census constrain data, each row is a different census region, each column represent a census category.

feat

a numerical vector representing the corresponding columns for each feature in the inds dataframe

tols

tolerence for the stopping point of the iteration of the raking algorism

Value

A dataframe weights


xinBrueck/raking documentation built on Aug. 6, 2019, 12:14 p.m.