Description Usage Arguments Value Note Note Examples
Generates a sample survey population with ages uniformly distributed in the specified range, (@p age.low, @p age.high), and all assigned the provided observation @p date.
1 | make.sample.pop(N, age.low, age.high, date)
|
N |
the number of samples, i.e. population size |
age.low |
the minimum age (in months) for the sample population |
age.high |
the maximum age (in months) for the sample population |
date |
the observation date to use for all samples |
a @c data.frame with @p N rows and two columns: @c date and @c age
@see runif
The lower and upper age limits will not be generated. This function uses @coderunif to generate age values and @c runif does not generate either extreme unless @code low = high or @code max - min is small.
If @p age.high < @p age.low, all generated ages will be @c NaN.
1 2 3 4 5 | make.sample.pop( N=10, age.low=0, age.high=25, date="2012-01-01" )
N <- 10
dates <- c( "2005-05-01" ,"2007-07-02", "2009-09-03" )
make.sample.pop( N, 0, 25, array(dates,dim=N) )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.