Extracts distribution-specific parameters (mean, sd, rate, shape, range) from
details subset. Auto-detects distribution type if not specified.
Usage
extract_distribution_params(details_subset, distribution_type = NULL)
Arguments
- details_subset
Data frame. Rows from details for one variable.
- distribution_type
Character. Optional ("normal", "uniform", "gompertz",
"exponential", "poisson"). If NULL, attempts auto-detection.
Value
Named list with distribution type and parameters:
distribution: Character. Distribution type.
mean, sd: Numeric. For normal distribution.
rate, shape: Numeric. For Gompertz/exponential.
range_min, range_max: Numeric. For uniform or truncation.
See also
Other mockdata-helpers:
apply_garbage(),
apply_missing_codes(),
apply_rtype_defaults(),
extract_proportions(),
generate_garbage_values(),
get_cycle_variables(),
get_raw_variables(),
get_variable_details(),
has_garbage(),
make_garbage(),
sample_with_proportions()
Examples
if (FALSE) { # \dontrun{
params <- extract_distribution_params(details_subset, "normal")
# Returns: list(distribution = "normal", mean = 25, sd = 5, range_min = 18.5, range_max = 40)
} # }