Last data update: 2014.03.03

Data Source

R Release (3.2.3)
CranContrib
BioConductor
All

Data Type

Packages
Functions
Images
Data set

Classification

Results 1 - 10 of 11 found.
[1] < 1 2 > [2]  Sort:

selectSample (Package: SamplingStrata) :

Once optimal stratification has been obtained (in the dataframe 'outstrata'), and a new frame has been built by assigning to the units of the old one the new stratum labels (by means of "updateFrame" function), it is possible to select a stratified sample from the frame with the srswor method. The result of the execution of "selectSample" function is a dataframe containing selected units, with the probabilities of inclusion. It is possible to output this dataframe in a .csv file. One more .csv file is produced ("sampling check"), containing coeherence checks between (a) population in frame strata (b) population in optimised strata (c) planned units to be selected in optimised strata (d) actually selected units (e) sum of weights in each stratum
● Data Source: CranContrib
● Keywords: survey
● Alias: selectSample
● 0 images

optimizeStrata (Package: SamplingStrata) :

This function runs a set of other functions to optimise the stratification of a sampling frame
● Data Source: CranContrib
● Keywords: survey
● Alias: optimizeStrata
32 images

var.bin (Package: SamplingStrata) :

The optimization of a frame stratification is applicable only in presence of all categorical auxiliary variables in the frame. If one or more continuous auxiliary variables are in the frame, it is necessary to pre-process in order to convert them into categorical (ordinal) variables. The applied method is the "k-means" clustering method contained in the in "stats" package. This function ensures that the final result is in an ordered categorical variable.
● Data Source: CranContrib
● Keywords: survey
● Alias: var.bin
● 0 images

checkInput (Package: SamplingStrata) :

This functions checks the internal structure of the different input dataframes ("errors", "strata" and "sampling frame"), and also the correctness of the relationships among them.
● Data Source: CranContrib
● Keywords: survey
● Alias: checkInput
● 0 images

buildStrataDF (Package: SamplingStrata) :

This function allows to build the information regarding strata in the population required as an input by the algorithm of Bethel for the optimal allocation. In order to estimate means and standard deviations for target variables Y's, we need data coming from: (1) a previous round of the survey whose sample we want to plan; (2) sample data from a survey with variables that are proxy to the ones we are interested to; (3) a frame containing values of Y's variables (or proxy variables) for all the population. In all cases, each unit in the dataset must contain auxiliary information (X's variables) and also target variables Y's (or proxy variables) values: under these conditions it is possible to build the dataframe "strata", containing information on the distribution of Y's in the different strata (namely, means and standard deviations), together with information on strata (total population, if it is to be censused or not, the cost per single interview). If the information is contained in a sample dataset, a variable named WEIGHT is expected to be present. In case of a frame, no such variable is given, and the function will define a WEIGHT variable for each unit, whose value is always '1'. Missing values for each Y variable will not be taken into account in the computation of means and standard deviations (in any case, NA's can be present in the dataset). The dataframe "strata" is written to an external file (tab delimited, extension "txt"), and will be used as an input by optimizeStrata.
● Data Source: CranContrib
● Keywords: survey
● Alias: buildStrataDF
● 0 images

updateStrata (Package: SamplingStrata) :

Once optimal stratification has been obtained ('outstrata'), then we need to attribute new strata labels to each atomic stratum. By executing this function, a new dataframe "newstrata" will be obtained with the same structure of the old, ("strata") but with the addition of a new stratum label. By indicating "YES" to "writeFile" parameter, the dataframe "newstrata" will be written to a delimited file ("newstrata.txt"). Also a second delimited file ("strata_aggregation.txt") will be outputted, containing the indication of the relations bewteen atomic and aggregated strata.
● Data Source: CranContrib
● Keywords: survey
● Alias: updateStrata
32 images

tuneParameters (Package: SamplingStrata) :

This function allows to execute a number of optimization runs, varying in a controlled way the values of the parameters, in order to find their most suitable values. by comparing the resulting solutions. It can be applied only to a given domain per time. Most parameters of this function are the same than those of the function 'optimizeStrata', but they are given in a vectorial format. The length of each vector is given by the number of optimizations to be run: it is therefore possible to define different combination of values of the parameters for each execution of 'optimizeStrata'. After each optimization run, from the corrisponding optimized frame a given number of samples are drawn. For each of them, the estimates of the target variables Y's are computed ("precision"), together with the associated coefficients of variations, and the absolute differences between the values of the estimates and the true values in the population ("bias"). Information on the distribution of bias (differences) and precision (CV's) are outputted, and also boxplots for each of them are produced, in order to permit a compared evaluation of the different solutions found in the different runs. As the optimal solution is stored for each run, after the evaluation it is possible to use it directly, or as a "suggestion" for a new optimization with more iterations (in order to improve it).
● Data Source: CranContrib
● Keywords: survey
● Alias: tuneParameters
● 0 images

updateFrame (Package: SamplingStrata) :

Once optimal stratification has been obtained, and new labels have been attributed to initial atomic strata ("newstrata"), it is important to report the new classification of units in the sampling frame by attributing new strata labels to each unit. By executing this function, a new frame will be obtained with the same structure of the old, but with the addition of a new stratum label. The initial frame must contain a variable named 'domainvalue' that indicates the same values of the domain that has been used with the 'optimizeStrata' function. If no domains have been defined, this variable will contains all 1's, but it must exist
● Data Source: CranContrib
● Keywords: survey
● Alias: updateFrame
● 0 images

evalSolution (Package: SamplingStrata) :

The user can indicate the number of samples that must be selected by the frame to which the optimal stratification has been applied. The allocation is the one reported in the dataframe 'outstrata'. First, the true values of the parameters are calculated from the frame. Then, for each sample the sampling estimates are calculated, together with the differences between them and the true values of the parameters. At the end, an estimate of the CV is produced for each target variable, in order to compare them with the precision constraints set at the beginning of the optimization process. If the flag 'writeFiles' is set to TRUE, boxplots of distribution of the CV's in the different domains are produced for each Y variable ('cv.pdf'), together with boxplot of the distributions of differences between estimates and values of the parameters in the population ('differences.pdf').
● Data Source: CranContrib
● Keywords: survey
● Alias: evalSolution
● 0 images

plotSamprate (Package: SamplingStrata) :

Once the optimization step has been carried out, by applying this function it is possible to obtain the visualization of the proportion of sampling units in the different strata for each domain in the obtained solution.
● Data Source: CranContrib
● Keywords: survey
● Alias: plotSamprate
● 0 images