Learn R Programming

dcce (version 0.4.2)

dcce_bootstrap: Bootstrap alias that avoids the broom conflict

Description

Convenience alias for bootstrap with an unambiguous name. broom::bootstrap is a data-frame resampling helper that shares a name with dcce::bootstrap but has a completely different signature. If you load broom after dcce the broom function masks ours on the search path and calls to bootstrap(fit, type = ..., reps = ...) will fail with an "unused arguments" error. dcce_bootstrap() is identical to dcce::bootstrap() but cannot be masked by any other package.

Usage

dcce_bootstrap(
  object,
  type = c("crosssection", "wild"),
  reps = 500L,
  percentile = TRUE,
  cfresiduals = FALSE,
  seed = NULL
)

Value

See bootstrap.

Arguments

object

A dcce_fit object.

type

Character: "crosssection" (default) or "wild".

reps

Integer: number of bootstrap repetitions. Default 500.

percentile

Logical: compute percentile CIs? Default TRUE.

cfresiduals

Logical: for wild bootstrap, use common-factor residuals instead of defactored residuals? Default FALSE.

seed

Integer: random seed for reproducibility. Default NULL.

See Also

bootstrap

Examples

Run this code
set.seed(42)
df <- data.frame(
  id = rep(1:10, each = 30),
  t  = rep(1:30, 10),
  y  = rnorm(300),
  x  = rnorm(300)
)
fit <- dcce(df, "id", "t", y ~ x, model = "mg", cross_section_vars = NULL)
dcce_bootstrap(fit, reps = 50)

Run the code above in your browser using DataLab