[R] How to use Subpopulation data?

Bernardo Rangel Tura tura at centroin.com.br
Thu Oct 1 12:24:09 CEST 2009

On Thu, 2009-10-01 at 10:06 +0000, KABELI MEFANE wrote:
> Dear Helpers
> I have a sample frame and i have sampled from it using three methods and now i want to calculate the statistics but i only get the population parameters.
> H <- matrix(rnorm(100, mean=50000, sd=5000))
> sampleframe=data.frame(type=c(rep("H",100)),value=c(H))
> sampleframe
> str=strata(sampleframe,c("type"),size=c(20,), method="srswor")

Try using

str=strata(sampleframe,c("type"),size=20, method="srswor")

or better

str <- strata(sampleframe,c("type"),size=20, method="srswor")

Bernardo Rangel Tura, M.D,MPH,Ph.D
National Institute of Cardiology

More information about the R-help mailing list