Skip to contents

Compute mean and non-parametric bootstrapped percentile confidence intervals

Usage

bootstrap_response_counts(
  df,
  formula,
  ci_variable = "P",
  R = 2000,
  CI = 0.97,
  .progress = TRUE
)

Arguments

df

Table with data

formula

Formula that specifies outcome variable, fixed and random effects.

ci_variable

Which variable to use for percentile confidence intervals, either "N" or "P" (default).

R

Number of samples for bootstrapping, default is 2000.

CI

Percentile confidence interval, default is 0.97

.progress

Logical, whether to show progress bar during bootstrapping. Default is TRUE.

Value

data.frame or tibble with fixed effects columns, as well as N, P, LowerCI, and UpperCI.

Examples

avg_prop <- bootstrap_response_counts(art, Response ~ Group + PaintingKind + Scale, R = 10)

avg_count <- bootstrap_response_counts(art,
                                       Response ~ Group + PaintingKind + Scale,
                                       ci_variable = "N",
                                       R = 10)