DesignLibrary (version 0.1.0)

cluster_sampling_designer: Create a design for cluster random sampling

Description

Builds a cluster sampling design of a population with N_clusters containing N_subjects_per_cluster. Estimations sample n_clusters each comprising n_subjects_per_cluster units. Outcomes within clusters have ICC approximately equal to ICC.

Usage

cluster_sampling_designer(N_clusters = 1000,
  N_subjects_per_cluster = 50, n_clusters = 100,
  n_subjects_per_cluster = 10, icc = 0.2)

Arguments

N_clusters

An integer. Total number of clusters in the population.

N_subjects_per_cluster

An integer of vector of integers of length N_clusters. Total number of subjects per cluster in the population.

n_clusters

An integer. Number of clusters to sample.

n_subjects_per_cluster

An integer. Number of subjects to sample per cluster.

icc

A number in [0,1]. Intra-cluster Correlation Coefficient (ICC).

Value

A cluster sampling design.

Details

Key limitations: The design assumes clusters draw with equal probability (rather than, for example, proportionate to size).

Examples

Run this code
# NOT RUN {
# To make a design using default arguments:
cluster_sampling_design <- cluster_sampling_designer()
# A design with varying cluster size
cluster_sampling_design <- cluster_sampling_designer(
  N_clusters = 10, N_subjects_per_cluster = 3:12, 
  n_clusters = 5,  n_subjects_per_cluster = 2)
# }

Run the code above in your browser using DataCamp Workspace