Learn R Programming

ILSAstats (version 0.4.0)

repcreate: Creation of Replicate Weights

Description

Creates replicate weights given jackknife replicates and jackknife zones.

Usage

repcreate(df, wt, jkzone, jkrep, repwtname = "RWT", reps = NULL, method)

repcreateILSA(study, year, df, repwtname = "RWT")

Value

a data frame.

Arguments

df

a data frame.

wt

a string specifying the name of the column (within df) with the total weights.

jkzone

a string specifying the name of the column in df that contains the jackknife zone information.

jkrep

a string specifying the name of the column in df that contains the jackknife replicate information.

repwtname

a string specifying the variable names for the replicate weights.

reps

an integer indicating the number of replications to be created. If NULL the maximum number of zones will be used.

method

a string indicating the name of the replication method. Available options are: "JK2-full", "JK2-half", and "JK2-half-1PV".

Additionally, ILSA names can be used, defaulting into:

  • "TIMSS" or "PIRLS" for "JK2-full";

  • "ICILS", "ICCS", or "CIVED" for "JK2-half"; and "oldTIMSS" or "oldPIRLS" for "JK2-half-1PV".

Note that "oldTIMSS" and "oldPIRLS" refer to the method used for TIMSS and PIRLS before 2015, where within imputation variance is estimated using only 1 plausible value.

study

a string indicating the study name. For checking available studies use ILSAinfo$weights.

year

a numeric value indicating the study year. For checking available years use ILSAinfo$weights.

Examples

Run this code

head(repdata)

# 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

head(RW)

Run the code above in your browser using DataLab