Skip to contents

A completely simulated example of 60 people with 8–12 daily learning scores and a unit-level measure of prior practice. These are teaching data, not measurements from real participants or a dataset used in the REPAIR paper.

Usage

repair_example

Format

A list with three elements:

repeated

A data frame with character person IDs, numeric day (days since baseline, starting at zero), and numeric score (arbitrary learning-score units).

people

A data frame with one row per person and numeric practice (simulated prior practice hours per week, between zero and ten).

truth

Generating constants and a random_effects data frame with unit IDs, intercept deviations, and slope deviations. For teaching comparisons only; these values must not enter an empirical REPAIR fit.

Source

Generated with base R using seed 20261029, Mersenne-Twister/Inversion/ Rejection RNG settings. The source repository contains the complete dev/generate_example_data.R script. These data are separate from the frozen numerical reference fixtures used to test the implementation.

Details

The generating model is score = 50 + b0 + (1 + b1) * day + error, with residual SD 1.5, b0 = 3 * z0, and b1 = 0.18 * (practice - 5) + 0.15 * z0 + 0.35 * z1, where z0 and z1 are independent standard normal variables. Practice is generated independently from a uniform distribution and rounded to one decimal place. The population association of slope deviation with one extra hour of practice is 0.18 score units per day. One finite sample need not recover this constant exactly. Fitted predictions are deviations from the estimated fixed effects, so their intercept/centering can differ from the generating population coefficients.

IDs are shared between the two tables. Observation counts vary, and each unit has an identifiable intercept/slope design. Loading the saved data does not generate random numbers or require the companion research repository.

Examples

data(repair_example)
head(repair_example$repeated)
#>   person day    score
#> 1   P001   0 57.78002
#> 2   P001   1 57.80489
#> 3   P001   2 58.22970
#> 4   P001   3 60.11052
#> 5   P001   4 62.93869
#> 6   P001   5 63.15122
head(repair_example$people)
#>   person practice
#> 1   P001      6.7
#> 2   P002      8.7
#> 3   P003      4.7
#> 4   P004      9.5
#> 5   P005      7.9
#> 6   P006      1.9
growth <- lme4::lmer(score ~ day + (day | person), repair_example$repeated)
fit <- repair(re("day") ~ practice, growth, repair_example$people, "person")
repair_coefficients(fit)
#>          term   estimate std.error statistic      p.value   conf.low  conf.high
#> 1 (Intercept) -0.7895289 0.1147252 -6.881913 5.905407e-12 -1.0143862 -0.5646716
#> 2    practice  0.1754854 0.0214190  8.192979 2.548385e-16  0.1335049  0.2174659
#>   conf.level
#> 1       0.95
#> 2       0.95