Description Usage Arguments Value Author(s) Examples
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.
1 2 3 4 5 6 7 8 9 10 11 |
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 |
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. |
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 |
Jonathan Lisic <jonathan.lisic@nass.usda.gov>
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
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.