sample_qb: Sample a Quebec mother

Description Usage Arguments Examples

Description

This function returns random draws of mother IDs from a selection of families being classified as 'fully documented'.

Usage

1
sample_qb(df_ind, n = 1, sub_sample = NULL)

Arguments

df_ind

A dataframe for individual data

n

Number of draws to perform. For n equal or larger the number of mothers in initial sample, the vector of all mother IDs is returned instead. Default is 1.

sub_sample

A vector of IDs, where IDs to return must be included.

Examples

1
2
3
4
df_ind <- get_exmpl_df()
df_ind$bdate <- sample(seq(as.Date("1774-12-31"), as.Date("1874-12-31"), 100), nrow(df_ind))
df_fam <- data.frame(idf = c(0,unique(df_ind$momid[df_ind$momid>0])), fall = "C")
sample_kh(df_ind, df_fam)

johow/kinlab documentation built on July 5, 2019, 4:23 p.m.