Learn R Programming

sampling (version 0.1)

cleanstrata: Clean strata

Description

Renumber a variable of stratification (qualitative variable). The strata receive a number from 1 to the last stratum. The empty strata are suppressed. This function is used in 'balancedstratification'.

Usage

cleanstrata(st)

Arguments

st
vector with the numbers of the strata.

See Also

balancedstratification

Examples

Run this code
# definition of the stratification variable
strat=c(-2,3,-2,3,4,4,4,-2,-2,3,4,0,0,0)
# renumber the strata
cleanstrata(strat)

Run the code above in your browser using DataLab