make draws of all observations with the same id in a panel data context. This is useful for bootstrapping with panel data.

blockBootSample(data, idname)

Arguments

data

data.frame from which you want to bootstrap

idname

column in data which contains an individual identifier

Value

data.frame bootstrapped from the original dataset; this data.frame will contain new ids

Examples

 if(!requireNamespace("plm")) {
  if(interactive() || is.na(Sys.getenv("_R_CHECK_PACKAGE_NAME_", NA))) {
    stop("package 'plm' is required for this example")
  } else q() }
#> Loading required namespace: plm
data("LaborSupply", package="plm")
bbs <- blockBootSample(LaborSupply, "id")
nrow(bbs)
#> [1] 5320
head(bbs$id)
#> [1] 1 1 1 1 1 1