BIFIE.data.jack {BIFIEsurvey} | R Documentation |
Create BIFIE.data
Object with Jackknife Zones
Description
Creates a BIFIE.data
object for designs with jackknife zones,
especially for TIMSS/PIRLS and PISA studies.
Usage
BIFIE.data.jack(data, wgt=NULL, jktype="JK_TIMSS", pv_vars=NULL,
jkzone=NULL, jkrep=NULL, jkfac=NULL, fayfac=NULL,
wgtrep="W_FSTR", pvpre=paste0("PV",1:5), ngr=100,
seed=.Random.seed, cdata=FALSE)
Arguments
data |
Data frame: Can be a single or a list of multiply-imputed datasets |
wgt |
A string indicating the label of case weight.
In case of |
pv_vars |
An optional vector of plausible values which define multiply-imputed datasets. |
jktype |
Type of jackknife procedure for creating the |
jkzone |
Jackknife zones. If |
jkrep |
Jackknife replicate factors. If |
jkfac |
Factor for multiplying jackknife replicate weights.
If |
fayfac |
Fay factor for statistical inference. The default is set to |
wgtrep |
Variables in the dataset which refer to the replicate
weights. In case of |
pvpre |
Only applicable for |
ngr |
Number of randomly created groups in |
seed |
The simulation seed if |
cdata |
An optional logical indicating whether the |
Value
Object of class BIFIEdata
See Also
Examples
#############################################################################
# EXAMPLE 1: Convert TIMSS dataset to BIFIE.data object
#############################################################################
data(data.timss3)
# define plausible values
pv_vars <- c("ASMMAT", "ASSSCI" )
# create BIFIE.data objects -> 5 imputed datasets
bdat1 <- BIFIEsurvey::BIFIE.data.jack( data=data.timss3, pv_vars=pv_vars,
jktype="JK_TIMSS" )
summary(bdat1)
# create BIFIE.data objects -> all PVs are included in one dataset
bdat2 <- BIFIEsurvey::BIFIE.data.jack( data=data.timss3, jktype="JK_TIMSS" )
summary(bdat2)
#############################################################################
# EXAMPLE 2: Creation of Jackknife zones and replicate weights for data.test1
#############################################################################
data(data.test1)
# create jackknife zones based on random group creation
bdat1 <- BIFIEsurvey::BIFIE.data.jack( data=data.test1, jktype="JK_RANDOM",
ngr=50 )
summary(bdat1)
stat1 <- BIFIEsurvey::BIFIE.univar( bdat1, vars="math", group="stratum" )
summary(stat1)
# random creation of groups and inclusion of weights
bdat2 <- BIFIEsurvey::BIFIE.data.jack( data=data.test1, jktype="JK_RANDOM",
ngr=75, seed=987, wgt="wgtstud")
summary(bdat2)
stat2 <- BIFIEsurvey::BIFIE.univar( bdat2, vars="math", group="stratum" )
summary(stat2)
# using idclass as jackknife zones
bdat3 <- BIFIEsurvey::BIFIE.data.jack( data=data.test1, jktype="JK_GROUP",
jkzone="idclass", wgt="wgtstud")
summary(bdat3)
stat3 <- BIFIEsurvey::BIFIE.univar( bdat3, vars="math", group="stratum" )
summary(stat3)
# create BIFIEdata object with a list of imputed datasets
dataList <- list( data.test1, data.test1, data.test1 )
bdat4 <- BIFIEsurvey::BIFIE.data.jack( data=dataList, jktype="JK_GROUP",
jkzone="idclass", wgt="wgtstud")
summary(bdat4)
## Not run:
#############################################################################
# EXAMPLE 3: Converting a PISA dataset into a BIFIEdata object
#############################################################################
data(data.pisaNLD)
# BIFIEdata with cdata=FALSE
bifieobj <- BIFIEsurvey::BIFIE.data.jack( data.pisaNLD, jktype="RW_PISA", cdata=FALSE)
summary(bifieobj)
# BIFIEdata with cdata=TRUE
bifieobj1 <- BIFIEsurvey::BIFIE.data.jack( data.pisaNLD, jktype="RW_PISA", cdata=TRUE)
summary(bifieobj1)
## End(Not run)