Skip to contents

Returns the bootstrap simulations for the parameter theta of pif or paf

Usage

get_theta_simulations(object)

Arguments

object

A pif_class object

Examples

#Example 1
data(ensanut)
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,
)
get_theta_simulations(pifsim)
#>              [,1]      [,2]
#>  [1,]  0.04483706 0.4694029
#>  [2,]  0.22994161 0.5410407
#>  [3,] -0.03102961 0.2832526
#>  [4,]  0.03558302 0.3630293
#>  [5,]  0.01817947 0.1265165
#>  [6,] -0.11991251 0.2198062
#>  [7,]  0.18327962 0.1596576
#>  [8,]  0.04848339 0.4604968
#>  [9,]  0.03726730 0.5005335
#> [10,] -0.08353623 0.5187293