runSimFromFixedValues: runSimFromFixedValues method

runSimFromFixedValuesR Documentation

runSimFromFixedValues method

Description

runSimFromFixedValues offers a way to configure and run a simulation from fixed values for race, sex, and birth year cohort rather than passing a data frame. It returns a dataframe of simulated smoking histories for n individuals.

Arguments

repeat

The number of individuals to simulate

race

(default = 0 and refers to all races combined)

sex

(0 for male, 1, for female)

cohort_year

(four digit birth cohort year)

Value

If attach_run_info = FALSE, a data.frame of repeat simulated individuals with columns smoking_initiation_age (-999 = never smoker), smoking_cessation_age, age_at_death, and cigarettes_per_day. If attach_run_info = TRUE, the same four-component bundle as shg_run; see that help page for definitions.

Examples

shg <- new(SHGInterface)
shg$input_data_folder <- system.file("extdata", "2018", package = "SmokingHistoryGenerator")
hist <- shg$runSimFromFixedValues(500, 0, 0, 1950)
head(hist)

SmokingHistoryGenerator documentation built on June 13, 2026, 1:08 a.m.