Synthetize: Synthetize

Description Usage Arguments Value Author(s)

Description

Create a synthetic population based on survey weights.

Usage

1

Arguments

data_in

(default = FALSE) an object of class gregwt, compute with the function gregwt

X

(default = FALSE) original survey, must be define if data_in is not data_in object will overwrite this parameter

w

(default = FALSE) output weights used to sample the survey. data_in object will overwrite this parameter. If data_in = FALSE and w = FALSE all weight will be set to 1.

benchmarks

(default = NULL) use extra benchmarks for the creation of synthetic individuals.

pop_size_input

(default = FALSE) total population size. This parameter will overwrite the parameter on data_in object.

method

(default = c('random', 1)) define the method for creating the synthetic population. (1) c('random', n) will output an array of size [pop,x,n] where pop is the population size, x are the number of parameters on the original survey and n are the number of random samples; (2) c('best', n) will output an array of size [pop,x], this array is the 'best' fit to benchmarks; (3) c('bestpop', n) similar to best bust gives more attention to population totals, important if running an integrated reweight.

errormetric

(default = "TAE") metric used for the computation of the error term. (a) 'TAE' total absolut error (default), (b) 'Z' modified Z-Statistic

distribution

(default = FALSE) FALSE = use weight as probability; ones = use a vector of ones as selection probability; uniform = use a random uniform distribution as selection probability.

HHsize_mean_fit

(default = 1.8) mean household size.

max_iter

(default = 100) maximal iterations

fit_tolerance

(default = 0.1) tolerance to achieve a fit

random_seed

(default = 12345) seed for random number generator, needed to reproduce results.

output

(default = FALSE) file to attached to the input survey.

output_log

(default = FALSE) create en output log of the simulation. This will create a file called Synthetic.out on the current working directory. This option will suppress the output to the command line. You can process the output by calling the function logtocsv() provided by this package.

verbose

(default = FALSE) be verbose.

Value

result matrix of synthetic population.

Author(s)

M. Esteban Munoz H.


emunozh/GREGWT documentation built on May 16, 2019, 5:11 a.m.