Learn R Programming

eatRep (version 0.15.1)

generateRandomJk1Zones: Generates random jackknife-1 zones based on sampling units in the data set.

Description

Function adds randomly generated jackknife-1 zones to the data.

Usage

generateRandomJk1Zones (datL, unit, nZones, name = "randomCluster")

Value

The original data with an additional column of the jackknife-zone variable

Arguments

datL

Data frame containing at least the primary sampling unit variable

unit

Variable name or column number of the primary sampling unit (i.e. student or class identifier)

nZones

integer: number of jackknife zones. Note: The umber of jackknife zones must not exceed the number of distinct sampling units

name

New name of the jackknife-zone variable in the data set

Examples

Run this code
data(lsa)

### We only consider year 2010
lsa10<- lsa[which(lsa[,"year"] == 2010),]
lsa10<- generateRandomJk1Zones(datL = lsa10, unit="idclass", nZones = 50)

Run the code above in your browser using DataLab