Alloc: Allocation

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/Alloc.R

Description

Allocate sample among several strata, using proportional allocation. Inputs population file and total sample size. Outputs sample sizes for each stratum

Usage

1
Alloc(popfile, ntotal)

Arguments

popfile

dataframe containing population data - as a minimum there must be columns named 'PID' (plot identifier), 'Strata' and 'plot_type'.

ntotal

total sample size - required number of reference plots for all strata combined.

Details

Performs a proportional allocation, by calculating the required sample size for each stratum (i) using the formula n_i = n * N_i / N, where n is the sample size (number of reference plots) and N is the number of target plots.

Value

A vector of sample sizes, one for each stratum in the population file.

Author(s)

G. Melville

See Also

Existing and NC.sample.

Examples

1
2
3
4
popfile<-data.frame(PID=1:20, Strata=rep(c('A', 'B'),c(12,8)),
 	plot_type=rep('B',20))
tot.samp<-6
Alloc(popfile, tot.samp)

NCSampling documentation built on May 1, 2019, 10:15 p.m.

Related to Alloc in NCSampling...