spTable | R Documentation |
Compute contingency tables of expected (i.e., estimated) and realized (i.e., simulated) population sizes. The expected values are obtained with the Horvitz-Thompson estimator.
spTable(inp, select)
inp |
an object of class |
select |
character; vector defining the columns in slots 'pop' and 'sample' of argument 'input' that should be used for tabulation. |
The contingency tables are computed with tableWt
.
A list of class "spTable"
with the following components:
expected |
the contingency table estimated from the survey data. |
realized |
the contingency table computed from the simulated population data. |
Sampling weights are automatically used from the input object 'inp'!
Andreas Alfons and Bernhard Meindl
spMosaic
, tableWt
set.seed(1234) # for reproducibility
data(eusilcS) # load sample data
## Not run:
samp <- specifyInput(data=eusilcS, hhid="db030", hhsize="hsize",
strata="db040", weight="db090")
eusilcP <- simStructure(data=samp, method="direct", basicHHvars=c("age", "rb090"))
res <- spTable(eusilcP, select = c("age", "rb090"))
class(res)
res
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.