Skip to contents

Computes the nominal total number of level-1 observations using double arithmetic to avoid 32-bit integer overflow, returning an integer scalar when within .Machine$integer.max and a finite numeric double otherwise.

Usage

spec_total_n(spec)

Arguments

spec

A spec_ir object.

Value

Integer or finite numeric scalar giving total level-1 observations.

Examples

spec <- new_spec_ir(
  design_type = "multilevel_sim",
  hierarchy = list(levels = 2L, n_clusters = 30L, cluster_size = 25L, icc = 0.2)
)
spec_total_n(spec)
#> [1] 750