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

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

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

Value

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

Examples

data(lsa)

### We only consider year 2010
lsa10<- lsa[which(lsa[,"year"] == 2010),]
lsa10<- generateRandomJk1Zones(datL = lsa10, unit="idclass", nZones = 50)
#> Warning: Number of zones (50) is large compared to the number of distinct units (219).