Skip to contents

Serialize a spec_ir object to YAML

Usage

as_spec_yaml(spec)

Arguments

spec

A spec_ir object.

Value

A character scalar containing YAML text.

Examples

spec <- new_spec_ir()
cat(as_spec_yaml(spec))
#> schema_version: 1.2.0
#> metadata:
#>   title: Untitled Statistical Study
#>   description: ''
#>   source_prompt: ~
#>   tags: []
#> design_type: monte_carlo_lm
#> hierarchy:
#>   levels: 1
#>   n_obs: 200
#>   n_clusters: ~
#>   cluster_size: ~
#>   cluster_size_dist: ~
#>   cluster_size_sd: ~
#>   time_points: ~
#>   time_spacing: ~
#>   cluster_name: ~
#>   unit_name: observation
#>   icc: ~
#> predictors:
#>   - name: x1
#>     level: 1
#>     distribution: normal
#>     mean: 0.0
#>     sd: 1.0
#>     prob: ~
#>     min: ~
#>     max: ~
#>     centering: none
#>     role: focal
#> predictor_corr: ~
#> outcome:
#>   name: 'y'
#>   family: gaussian
#>   link: identity
#>   residual_sd: 1.0
#>   error_dist: normal
#>   error_df: ~
#>   error_skew: ~
#>   ar1_rho: ~
#> effects:
#>   intercept: 0.0
#>   fixed:
#>     x1: 0.3
#>   interactions: []
#>   focal_predictor: x1
#>   random:
#>     intercept: no
#>     intercept_sd: ~
#>     slopes: []
#>     corr_matrix: ~
#> missingness:
#>   mechanism: none
#>   rate: 0.0
#>   target: outcome
#>   auxiliary: ~
#>   strength: ~
#> estimator:
#>   engine: lm
#>   reml: yes
#>   conf_level: 0.95
#>   missing_handling: complete_case
#> simulation:
#>   n_reps: 200
#>   seed: 2026
#>   alpha: 0.05
#>   parameter_grid: {}
#> defaults_rationale:
#>   hierarchy.levels: Defaulted to 1-level hierarchy based on design_type 'monte_carlo_lm'.
#>   hierarchy.n_obs: Defaulted sample size to 200 observations for adequate single-level
#>     precision.
#>   predictors: Added a default standardized normal focal predictor 'x1' (mean = 0,
#>     sd = 1).
#>   outcome.family: Defaulted outcome family to 'gaussian' for a continuous response.
#>   outcome.residual_sd: Defaulted level-1 residual SD to 1.0 so fixed effects are on
#>     a standardized scale.
#>   effects.fixed.x1: Defaulted fixed effect for 'x1' to 0.30.
#>   missingness.mechanism: Defaulted to complete data ('none'); enable MCAR or MAR to
#>     study attrition.
#>   estimator.engine: Selected 'lm' estimator matching the 1-level gaussian model.
#>   simulation.n_reps: Defaulted to 200 Monte Carlo replications for responsive prototyping;
#>     increase to 500-2000 for publication precision.
#>   simulation.seed: Set deterministic random seed to 2026 for full reproducibility.
#>   simulation.alpha: Defaulted nominal Type I error rate (alpha) to 0.05 (two-sided).