optimStrat (version 2.4)

optiallo: Optimal allocation in stratified simple random sampling

Description

Allocates a sample of size n using Neyman optimal allocation in Stratified Simple Random Sampling.

Usage

optiallo(n, x, stratum = NULL, ...)

Value

A list with two elements:

stratum

a vector indicating the stratum to which each element belongs.

nh

a vector indicating the sample size of the strata to which each element belongs.

Arguments

n

a positive integer indicating the desired sample size.

x

a positive numeric vector giving the values of the auxiliary variable.

stratum

a vector indicating the stratum to which every unit belongs (see ‘Details’).

...

other arguments passed to stratify (see ‘Details’).

Details

Allocates a sample of size n using Neyman optimal allocation in Stratified Simple Random Sampling.

If stratum==NULL, the stratification is generated via stratify. Then at least the number of strata should be passed to stratify using the argument H.

See Also

stratify for defining the stratification using the cum-sqrt-rule.

Examples

Run this code
x<- 1 + sort( rgamma(100, shape=4/9, scale=108) )
st1<- stratify(x,H=6)
optiallo(n=30,x,stratum=st1)

optiallo(n=30,x,H=6)

Run the code above in your browser using DataLab