Learn R Programming

simPop (version 1.1.1)

addWeights<-: Methods for function addWeights

Description

allows to modify sampling weights of an '>dataObj or '>simPopObj-object. As input the output of calibSample must be used.

Usage

addWeights(object) <- value

# S4 method for dataObj addWeights(object) <- value

# S4 method for simPopObj addWeights(object) <- value

Arguments

object

an object of class '>dataObj or '>simPopObj.

value

a numeric vector of suitable length

Examples

Run this code
# NOT RUN {
data(eusilcS)
data(totalsRG)
inp <- specifyInput(data=eusilcS, hhid="db030", hhsize="hsize", strata="db040", weight="db090")
# }
# NOT RUN {
## approx. 20 seconds ...
addWeights(inp) <- calibSample(inp, totalsRG)
# }

Run the code above in your browser using DataLab