new_sampling_result: Construct a sampling_result object

View source: R/base-sampling-result.R

new_sampling_resultR Documentation

Construct a sampling_result object

Description

Internal constructor for the S3 class shared by every estimation and sample-size function in the package. It bundles the point estimate, variance/standard error, confidence interval, a step-by-step record of the calculation, and a short pedagogical note into a single object so that every function in sampleone returns a consistent, richly documented result rather than a bare number.

Usage

new_sampling_result(
  metodo,
  estimativa,
  variancia = NULL,
  intervalo_confianca = NULL,
  nivel_confianca = NULL,
  memoria_calculo = character(),
  interpretacao = NULL,
  insight = NULL,
  referencias = character(),
  formula_apostila = character(),
  dados_entrada = list()
)

Arguments

metodo

Character. Short label for the sampling method/formula used (e.g. "AAS sem reposicao - media").

estimativa

Named list with the main numeric result(s), e.g. list(media = 20, n = 47).

variancia

Optional named list with variance/standard-error components.

intervalo_confianca

Optional numeric vector of length 2, or NULL when not applicable.

nivel_confianca

Numeric confidence level used, e.g. 0.95.

memoria_calculo

Character vector with a human-readable, step-by-step trace of the calculation.

interpretacao

Character scalar with a plain-language interpretation of the result.

insight

Character scalar with a short pedagogical suggestion (e.g. pointing to a related method worth comparing).

referencias

Character vector of bibliographic references backing the formula used, beyond the course notes.

formula_apostila

Character scalar identifying the equation number(s) in the source course notes (e.g. "(3.15)").

dados_entrada

Named list with the (validated) inputs actually used by the function, for transparency and reproducibility.

Value

An object of class sampling_result.


sampleone documentation built on Oct. 13, 2026, 5:07 p.m.