Hi Everybody
Its me again. I have been able to sample using SRS and stratified sampling when
i have predefined groups as follows:
Hypermarket <- matrix(rnorm(100, mean=50000, sd=5000))
Supermarket <- matrix(rnorm(400, mean=34000, sd=3000))
Minimarket <- matrix(rnorm(1000, mean=10000,sd=2000))
Cornershop <- matrix(rnorm(1500, mean=2500, sd=500))
Spazashop <- matrix(rnorm(2000, mean=1000, sd=250))
dat=data.frame(type=c(rep("Hypermarket",100),
rep("Supermarket",400),
rep("Minimarket",1000),rep("Cornershop",1500),
rep("Spazashop",2000)),
value=c(Hypermarket, Supermarket, Minimarket, Cornershop,Spazashop))
dat
names(dat)=c("type","value")
#Number of observations for each outlet type in a population
dat$type <- factor(dat$type,
levels =
c("Hypermarket","Supermarket","Minimarket","Cornershop","Spazashop"))
(stratas<-data.frame(table(dat$type)))
##sampling and proportional allocation
as.matrix(table(dat$type))
s=strata(dat,c("type"),size=c(20,80,200,300,400),
method="srswor")
dat.strat<-getdata(dat,s)
dat.strat
Now i want to use the rectangular method to determine strata boundaries, thenfor
the allocation use Neyman, so please help me achieve this.
[[alternative HTML version deleted]]