Simulation Code for Conditional-Mean Inference in Random-Lot Stability Models
Description
This repository contains the data and code supplement for "Degrees-of-Freedom Approximations for Conditional-Mean Inference in Random-Lot Stability Analysis" (Karl, Rushing, Burdick, Hofer). The supplement supports full reproduction of the paper's worked example, figures, and simulation results across SAS, R, and Python. Worked example. The dataset (stability_example_data.csv and stability_example_data.jmp, 14 lots, 9 time points) illustrates how denominator degrees-of-freedom (DDF) choice affects lot-specific conditional-mean confidence limits in random-lot stability mixed models. The JMP table includes three attached scripts — "Default DDF," "Contain DDF," and "Base JMP (Pro not required)" — that reproduce the conditional profilers. The scripts fit the random-intercept model (Model 2); users can add Lot×Months as a random effect in the Fit Model dialog to explore the random intercept-and-slope model (Model 1). The SAS script stability_single_run.sas reproduces the PROC MIXED fits under OLS, CONTAIN, SAT, and Kenward-Roger DDF options, and Fig_2_Lot_G_bands.csv provides the exported Lot G conditional-mean band data used in the overlay figure. Simulation code (SAS). The main SAS programs are organized into numbered folders: decision operating-characteristic simulations at a proposed 48-month expiry (Folder 1), pointwise coverage diagnostics (Folder 2), mechanism simulations for mean margin and denominator degrees of freedom (Folder 3), and the Appendix B Satterthwaite reconstruction runs (Folder 4). Folder 5 contains supplementary analyses: Kenward-Roger mechanism and worked-example comparisons, SAT-reduced variance-contribution threshold sensitivity (5%, 10%, 20%), SAT_covtest25 p-value comparator, and matched Model (1) data-generating simulations. A spotcheck folder repeats the main decision simulations under a tighter 52-month mean-trend calibration. Analytical scripts (R and Python). Two R scripts compute the known-variance multivariate-normal reference curves for Appendix A under the primary Model (2) and matched Model (1) data-generating processes. Four Python scripts generate the paper's mechanism figures and the Appendix B/C diagnostic calculations, including the closed-form balanced-design prediction variance map, the delta-method Satterthwaite DDF concavity analysis, and a parametric bootstrap corroboration of the worked-example prediction-variance variability. A README file in the root directory maps each script to its corresponding paper section and specifies the recommended run order.