ChangeSvyTable {jstable} | R Documentation |
ChangeSvyTable: Modify the number n
Description
Replace the number of weights taken into account with the number of n in the original data
Usage
ChangeSvyTable(svy, ori)
Arguments
svy |
TableOne object that take weights into account |
ori |
TableOne object in the original data |
Details
DETAILS
Value
A matrix that replaces the n number of weights with the n number of the original data
Examples
# example code
library('survey'); library('tableone')
data(nhanes)
nhanes$SDMVPSU <- as.factor(nhanes$SDMVPSU)
nhanesSvy <- svydesign(
ids = ~SDMVPSU, strata = ~SDMVSTRA, weights = ~WTMEC2YR,
nest = TRUE, data = nhanes
)
res <- svyCreateTableOne(
vars = c("HI_CHOL", "race", "agecat", "RIAGENDR"),
strata = "RIAGENDR", data = nhanesSvy,
factorVars = c("HI_CHOL", "race", "RIAGENDR")
)
ori <- CreateTableOne(
vars = c("HI_CHOL", "race", "agecat", "RIAGENDR"),
strata = "RIAGENDR", data = nhanes,
factorVars = c("HI_CHOL", "race", "RIAGENDR")
)
ChangeSvyTable(res, ori)
[Package jstable version 1.3.13 Index]