Description Usage Arguments Value Examples
This function exchanges sampling units between strata to minimize the target
coefficient of variation (CV), every few steps (as determined by
sampleUpdateIterations
) a number of iterations are performed to improve
the target CV by changing the sample allocation.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
x |
(Required) A matrix where each row is a sampling unit and each column is a characteristic of the sampling unit. Multiple observations of the same PSU can be included by including additional rows for each observation. When data is presented in this manner, the average CV of each characteristic is used in the objective function. e.g. for 3 observations per PSU: PSU Observation of PSU .... data 1 1 1 2 1 3 2 1 2 2 2 3 . . . . . . Note that only |
label |
(Required) Integer valued initial stratum assignment. |
targetCV |
(Required) A vector of target CVs. This vector must be of equal length
to the number of columns of |
sampleSize |
(Required) sample size, either an integer valued scalar that will be equally split between strata, or a sample size for each strata. When the sample size cannot be split excess sample allocations will be given to strata in increasing order. |
weightMatrix |
A matrix of size |
iterations |
Number of iterations to perform of the simulated annealing procedure. |
sampleSizeIterations |
Number of iterations for each sample Allocation update step (0 = no changes). |
recalcIterations |
Number of iterations to wait until recalculating the variance (0 = every iteration). |
locationAdjustment |
A constant value added to the population variable for each administrative
variable, this is of the same size and layout of |
scaleAdjustment |
A constant value multiplied by the population variable (before the location
adjustment) for each administrative variable, this is of the same size and
layout of |
penalty |
The penalty vector used for each of the CV targets penalties. Penalties with negative elements are ignored. A scalar value may be used, and will be repeated for all CVs. |
p |
The exponent for the penalty function, fractional exponents are available. |
cooling |
Cooling Schedule (0 = exchange only). |
preserveSatisfied |
|
fpc |
|
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 "selected": index of PSU, "from": current stratum of selected PSU , "to": candidate stratum of selected PSU, "n_h": sample size (h is the index or label associated with strata), column names or numbers if not presented |
cost |
Objective Function |
label |
Final Label |
sampleSize |
Final Sample Size |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # 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))
# run minCV for a sample size of 20
b <- saMinCV(
x,
label,
targetCV=c(0.08, 0.10, 0.05, 0.08),
sampleSize=20
)
summary(b)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.