DesVar {NCSampling} | R Documentation |
Design variances for NC sample.
Description
For each stratum ,and for the population as a whole, approximate design variances are calculated.
Usage
DesVar(popfile, nrefs, desvars, yvars, kvalue, B=1000, zvars=NULL,
training=NULL, xvars=NULL, pool=F)
Arguments
popfile |
dataframe containing information on all plots in the population. |
nrefs |
vector containing the sample size of each stratum. |
desvars |
vector containing the names of the design variables. |
yvars |
character vector containing the name of each variable of interest (dependent variable) for which design variances are required. |
kvalue |
scalar specifying the value of k for the k-nn imputation. |
B |
number of re-samples used to calculate the design variances. |
zvars |
character vector containing the name/s of the predictor variables. |
training |
dataframe containing the data needed to determine the predictor variable. Must contain the necessary yvars and xvars. If missing, predictor variables are supplied by the user (zvars) |
xvars |
character vector containing the name/s of the predictor variables. |
pool |
logical value - should strata be pooled prior to fitting regression model? |
Details
Approximate design variances are calculated using a re-sampling procedure in conjunction with a predictor variable. The predictor variable can be user-supplied or determined by the program using random forest regression based on a set of training data. The regression model can be fitted separately for each strata (pool=F), the default, or based on pooled training data with stratum included in the regression model as a factor.
Value
A dataframe containing the design variances for each stratum and for the whole population.
Author(s)
G. Melville
See Also
Examples
## DesVar(popfile, nrefs, desvars, yvars, B=1000, zvars=NULL,
## training=NULL, xvars=NULL, pool=F)