saEqualClus: Optimal Equal Sized Strata Formation and Allocation Using...

Description Usage Arguments Value Author(s) Examples

View source: R/saEqualClus.R

Description

This function minimizes the sample size for equally sized strata by exchanging sampling units between strata. Optimization is performed under variance constraints for known administrative variables.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
saEqualClus(
      x, 
      label, 
      iterations=1000, 
      cooling=0, 
      segments=rep(1,nrow(x)), 
      controlVariable=rep(1,nrow(x)), 
      targetVar, 
      varWithin=rep(0,ncol(x)), 
      tolSize=0.05
    )

Arguments

x

(Required) A matrix where each row is a sampling unit and each column is a characteristic of the sampling unit that is to be reduced in optimal sampling size.

label

(Required) Initial stratum assignment.

iterations

Number of iterations to perform of the simulated annealing procedure.

cooling

Cooling schedule (0 = exchange only).

segments

Number of secondary sampling units.

controlVariable

Control variable that enforces equality constraints. If a control variable is specified it must exist for each member of the population.

targetVar

(Required) A vector of target variances for each administrative variable. This vector must be of equal length to the number of columns of x.

varWithin

This parameter is used to account for within PSU variance. It is a constant value added to the target variance and PSU variance at each iteration.

tolSize

Acceptable difference proportion between strata sums of the control variable.

Value

accept

Matrix with three columns and a row for each iteration,

"change": change in objective function,

"U": uniform random variable,

"accepted":

1 - accepted,

0 - not accepted

cost

Objective Function

label

Final Label

Author(s)

Jonathan Lisic <[email protected]>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# data set with 100 observations and four characteristics 
# split between two strata
x <- matrix(rnorm( 100*4 ),ncol=4)  

# create an initial set of strata assignments 
label <- c(rep(0,50),rep(1,50)) 

#target variance
targetVar <- c(10000, 20000,30000, 40000) 

# run equal cluster
a <- saEqualClus(
  x,
  label,
  cooling=20,
  targetVar=targetVar
)

jlisic/saAlloc documentation built on May 5, 2018, 6:36 p.m.