Learn R Programming

asbio (version 0.3-1)

anm.samp.design: Animated demonstration of randomized sampling designs

Description

Animated Comparisons of outcomes from simple random sampling, stratified random sampling and cluster sampling.

Usage

anm.samp.design(n=20, interval = 0.5 ,iter = 30)

samp.design(n = 20)

anm.samp.design.tck()

Arguments

n
The number of samples to be randomly selected from a population of 400.
interval
Time length spent on each frame in animation (in seconds).
iter
Number of random iterations in animation.

Value

  • A plot is returned with four subplots. (a) shows the population before sampling, (b) shows simple random sampling, (c) shows stratified random sampling, (d) shows cluster sampling. The function anm.samp.design.tck provides interaction with a tcltk GUI.

Details

Returns a plot comparing outcomes of random sampling, stratified random sampling and cluster sampling from a population of size 400. For stratified random sampling the population is subdivided into four equally strata of size 100. and n/4 samples are taken within each strata. For cluster sampling the population is subdivided into four equally sized clusters and a census is taken from two clusters (regardless of specification of n). The function anm.samp.design depicts random sampling using animation

Examples

Run this code
samp.design(20)

#Animated demonstration
anm.samp.design(20)

Run the code above in your browser using DataLab