Skip to contents

Method for obtaining the number of bootstrap simulations used to construct a pif_class object.

Usage

n_bootstrap(x)

Arguments

x

A pif_class object

Examples

#Example 1
options(survey.lonely.psu = "adjust")
design <- survey::svydesign(data = ensanut, ids = ~1, weights = ~weight, strata = ~strata)
rr <- function(X, theta) {
  exp(-2 +
    theta[1] * X[, "age"] + theta[2] * X[, "systolic_blood_pressure"] / 100)
}
cft <- function(X) {
  X[, "systolic_blood_pressure"] <- X[, "systolic_blood_pressure"] - 5
  return(X)
}
pifsim <- pif(design,
  theta = log(c(1.05, 1.38)), rr, cft,
  additional_theta_arguments = c(0.01, 0.03), n_bootstrap_samples = 10,
)
n_bootstrap(pifsim)
#> [1] 10