Description Usage Arguments Value Examples
Cantrance remnant; use row IDs to reconstruct a single bootstrap of data
1 | build_simpop(datalist, rowlist, sim)
|
datalist |
List of data frames containing the data to be bootstrapped then combined into a single data frame. Each data frame should refer to a different characterisic of individuals in the population, e.g. 1st data frame is sex, 2nd data frame is age |
rowlist |
List of data frames containing row numbers for bootstrapping the data in datalist. Row numbers of rowlist[[i]] refer to datalist[[i]] |
sim |
Simulation number, i.e. which column of rowlist elements to use |
Data frame with characteristics from datalist in proportion to their appearance in rowlist[[sim]]
1 2 3 4 5 6 7 8 9 | # Possible characteristics
pop <- list(data.frame(male=0),
data.frame(age=c(20,30,40)))
# Actual characteristics for each of 2 sims, specified by rows, for pop size = 10
rows <- list(matrix(1, nrow=10, ncol=2),
matrix(sample.int(3, 20, replace=TRUE), nrow=10, ncol=2))
# Population using sim 1
build_simpop(pop, rows, 1)
build_simpop(pop, rows, 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.