repmean | R Documentation |
Estimates the mean, variance and standard deviation with replicate weights
for a variable or a group of variables and for one or more
populations. For a detailed explanation on how the standard errors are estimated
see repse
.
repmean(
x,
PV = FALSE,
setup = NULL,
repwt,
wt,
df,
method = c("TIMSS", "PIRLS", "ICILS", "ICCS", "PISA", "TALIS"),
var = c("unbiased", "ML"),
group = NULL,
by = NULL,
exclude = NULL,
zones = NULL
)
x |
a string vector specifying variable names (within |
PV |
a logical value indicating if the variables in |
setup |
an optional list produced by |
repwt |
a string indicating the common names for the replicate weights
columns (within |
wt |
a string specifying the name of the column (within |
df |
a data frame. |
method |
a string indicating the name of the large-scale assessment
to determine the replication method to use. Available options are:
|
var |
a string indicating the method to use for the variance:
|
group |
a string specifying the variable name (within |
by |
a string specifying a second variable (within |
exclude |
a vector indicating which groups
(in the same format as |
zones |
a string specifying the name of the variable containing the
replicate zones.
Used for calculating the number of zones to be used by variable and group.
If |
a data frame or a list.
# Creation of replicate weights
RW <- repcreate(df = repdata, # the data frame with all the information
wt = "wt", # the total weights column name
jkzone = "jkzones", # the jkzones column name
jkrep = "jkrep", # the jkreps column name
repwtname = "REPWT", # the desired name for the rep weights
reps = 50, # the number of replications
method = "ICILS") # the name of the method aka the study name
### No groups ----
# One variable - weights within df
repmean(x = c("item01"),
PV = FALSE,
repwt = "REPWT", wt = "wt", df = cbind(repdata,RW),
method = "ICILS",var = "ML",zones = "jkzones")
# One variable - weights as a separate data frame
repmean(x = c("item01"),
PV = FALSE,
repwt = RW, wt = "wt", df = repdata,
method = "ICILS",var = "ML",zones = "jkzones")
# Multiple variables
repmean(x = c("item01","item02","item03"),
PV = FALSE,
repwt = RW, wt = "wt", df = repdata,
method = "ICILS",var = "ML",zones = "jkzones")
# One PV variable
repmean(x = paste0("Math",1:5),
PV = TRUE, # if set to TRUE, PVs will be treated as separate variables
repwt = RW, wt = "wt", df = repdata,
method = "ICILS",var = "ML",zones = "jkzones")
### Groups ----
# One variable
repmean(x = c("item01"),
PV = FALSE,
repwt = RW, wt = "wt", df = repdata,
method = "ICILS",var = "ML",zones = "jkzones",
group = "GROUP",
exclude = "GR2") # GR2 will not be used for Pooled nor Composite
# Multiple variables
repmean(x = c("item01","item02","item03"),
PV = FALSE,
repwt = RW, wt = "wt", df = repdata,
method = "ICILS",var = "ML",zones = "jkzones",
group = "GROUP",
exclude = "GR2") # GR2 will not be used for Pooled nor Composite
# One PV variable
repmean(x = paste0("Math",1:5),
PV = TRUE, # if set to TRUE, PVs will be treated as separate variables
repwt = RW, wt = "wt", df = repdata,
method = "ICILS",var = "ML",zones = "jkzones",
group = "GROUP",
exclude = "GR2") # GR2 will not be used for Pooled nor Composite
### Groups and By ----
# One variable
repmean(x = c("item01"),
PV = FALSE,
repwt = RW, wt = "wt", df = repdata,
method = "ICILS",var = "ML",zones = "jkzones",
group = "GROUP",
by = "GENDER", # results will be separated by GENDER
exclude = "GR2") # GR2 will not be used for Pooled nor Composite
# One PV variable
repmean(x = paste0("Math",1:5),
PV = TRUE, # if set to TRUE, PVs will be treated as separate variables
repwt = RW, wt = "wt", df = repdata,
method = "ICILS",var = "ML",zones = "jkzones",
group = "GROUP",
by = "GENDER", # results will be separated by GENDER
exclude = "GR2") # GR2 will not be used for Pooled nor Composite
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.