Description Usage Arguments Examples
This function allows you to make estimation or sample size determinations for surveys using cluster random sampling.
1 2 3 |
y |
The total of all observations in the sample needed for mean and total estimation. |
B |
The desired bound on the estimation. Required for sample size determination. |
a |
The total number of elements in cluster with the characteristic of interest. Needed for estimating the proportion. |
N |
The number of clusters in the population. Required. |
m |
The number of elements per sampled cluster. |
M |
The number of elements in the population. |
p |
The population proportion. |
sig2 |
The population variance. |
sample.size.det |
Logical statement indicating if the action should be sample size determination. If false, estimation occurs. |
estimate |
Indicate the desired statistic to be estimated. Options include: mean, total, and proportion. |
alpha |
Significance level. |
1 2 3 4 5 6 | survsamp.cluster(N=12,M=100,sig2=35000,estimate="mean",
B=9,sample.size.det=TRUE)
set.seed(123019)
m=rpois(9,10)
survsamp.cluster(y=rpois(9,100),m=m,N=12,M=100,estimate="total")
survsamp.cluster(a=m-rpois(9,3),m=m,N=12,M=100,estimate="proportion")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.