rss.prop.simulation {generalRSS} | R Documentation |
Generate example ranked set samples for proportions
Description
The rss.prop.simulation function generates ranked set samples for proportions by simulating data with options to adjust the population proportion (p).
Usage
rss.prop.simulation(H, nsamp, p)
Arguments
H |
The RSS set size. |
nsamp |
A numeric vector specifying the sample allocation for each stratum. |
p |
The true population proportion. |
Details
This function simulates balanced or unbalanced RSS sampling for proportions. The length of the sample allocation vector (nsamp) must match the set size (H). The p parameter adjusts the true population proportion. The simulations assumes perfect ranking.
Value
rank |
The rank information assigned to each sample. |
y |
The generated ranked set samples (binary values) based on the population proportion. |
Examples
## Balanced RSS with a set size 3 and equal sample sizes of 6 for each stratum,
## using perfect ranking with true proportion of 0.6.
rss.prop.data=rss.prop.simulation(H=3,nsamp=c(6,6,6),p=0.6)
## Unbalanced RSS with a set size 3 and different sample sizes of 6, 10, and 8 for each stratum,
## using perfect ranking with true proportion of 0.2.
rss.prop.data=rss.prop.simulation(H=3,nsamp=c(6,10,8),p=0.2)
# Check the structure of the RSS data
colnames(rss.prop.data) # Should include "y" and "rank"
head(rss.prop.data$y)
head(rss.prop.data$rank)
[Package generalRSS version 0.1.3 Index]