For each stratum ,and for the population as a whole, approximate design variances are calculated.
DesVar(popfile, nrefs, desvars, yvars, kvalue, B=1000, zvars=NULL, training=NULL, xvars=NULL, pool=F)
dataframe containing information on all plots in the population.
vector containing the sample size of each stratum.
vector containing the names of the design variables.
character vector containing the name of each variable of interest (dependent variable) for which design variances are required.
scalar specifying the value of k for the k-nn imputation.
number of re-samples used to calculate the design variances.
character vector containing the name/s of the predictor variables.
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)
character vector containing the name/s of the predictor variables.
logical value - should strata be pooled prior to fitting regression model?
A dataframe containing the design variances for each stratum and for the whole population.
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.
## DesVar(popfile, nrefs, desvars, yvars, B=1000, zvars=NULL,
## training=NULL, xvars=NULL, pool=F)
Run the code above in your browser using DataLab