GA4Stratification {} | R Documentation |
This is a package for Genetic Algorithm approach for the determination of the stratum boundaries and sample sizes in each stratum in stratified sampling.
Şebnem Er, Timur Keskintürk, Charlie Daly
Maintainer: Sebnem Er e-mail: sebnem.er@uct.ac.za, er.sebnem@gmail.com
Package: | GA4Stratification |
Type: | Package |
Version: | 1.0 |
Date: | 2010-12-03 |
License: | GPL-2 |
LazyLoad: | yes |
GA4Stratification(dataName, numberOfStrata, sampleSize, iteration, GAgenerationSize, mutationRate, sampleAllocation)
Since the package is not in CRAN package repository yet, these steps should be followed in order to use the package:
The file can be saved as a zip document. Then after extracting the zip file into your R library where R is downloaded, the R package is ready to use in Windows. The R library is something like this in my computer:
C:\Program Files\R\R-2.10.1\library
First open an R console and type:
library(GA4Stratification) data(iso2004) data(P75) data(chi1) data(chi5) data(chi10) data(chi15) data(normal100_10) data(beta10_3) GA4Stratification(iso2004,2,80,1000,50,0.15,"Equal")
By just typing the name of the data, and defining the following arguments, you can obtain the boundaries and sample sizes to be drawn from each stratum with Genetic Algorithm developed by Keskinturk and Er (2007) given a sampling allocation scheme. The sampling allocation scheme could be either "Equal", "Proportional", "Neyman" or "GA" sampling allocation scheme.
dataName |
Any type of numeric data containing the values of a univariate stratification variable. |
numberOfStrata |
An integer: The number of strata. |
sampleSize |
An integer: The number total sample size. |
iteration |
An integer: The number of iterations in Genetic Algorithm process. |
GAgenerationSize |
An integer: The number of generations in Genetic Algorithm process. |
mutationRate |
A numeric: The mutation rate in Genetic Algorithm process. Mutation rate must be in between 0 and 1, inclusive. Small levels of mutation rate is preferable in Genetic Algorithms. |
sampleAllocation |
A string: sampleAllocation defines the type sample allocation method, which are "Equal", "Proportional", "Neyman" and "GA". |
This study is part of a project supported by the Scientific and Technological Research Council of Turkey (TUBITAK).
The function is currently defined as: function(dataName,numberOfStrata,sampleSize,iteration,GAgenerationSize,mutationRate,sampleAllocation) { if(sampleAllocation == "Equal") { GA4StratificationP1(dataName,numberOfStrata,sampleSize,iteration,GAgenerationSize,mutationRate) } else if(sampleAllocation=="Proportional") { GA4StratificationP2(dataName,numberOfStrata,sampleSize,iteration,GAgenerationSize,mutationRate) } else if(sampleAllocation == "Neyman") { GA4StratificationP3(dataName,numberOfStrata,sampleSize,iteration,GAgenerationSize,mutationRate) } else if (sampleAllocation == "GA") { GA4StratificationP4(dataName,numberOfStrata,sampleSize,iteration,GAgenerationSize,mutationRate) } }
iso2004
,
P75
,
chi1
,
chi5
,
chi10
,
chi15
,
normal100_10
,
beta10_3
,
randomnumGenerator