Skip to content

Spread the stress scores that piled up at 40 - #58

Merged
PeterSlijkhuis merged 1 commit into
mainfrom
stress-scale
Oct 8, 2026
Merged

PeterSlijkhuis merged 1 commit into
mainfrom
stress-scale

Conversation

@PeterSlijkhuis

@PeterSlijkhuis PeterSlijkhuis commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

Before: stress in wellbeing-population.csv was clipped at 40, so 190 of the 5000 students sat on exactly 40.00. That showed up as a spike at the right edge of every stress histogram.

After: stress still runs from 0 to 40, like the Perceived Stress Scale, with the same skewed shape and no spike.

How: a draw past 40 now wraps back round to the start of the scale instead of being clipped (scripts/generate-datasets.mjs). Because the exponential is memoryless, the result is exactly an exponential cut off at 40. The number of random draws is unchanged, so only the 189 students who were at the ceiling change. Their sleep and exam scores change too, because both depend on stress. workplace.csv is unchanged.

Every lesson code block in Modules 5 to 8 that reads the population was run in R on the old and the new data. Each number the lessons quote from that output was then updated: means, SDs, z-scores, cut-offs, the confidence intervals in 7-1 and 7-2, the Business row in 7-3, the sleep study's t-test, p-value and d in 8-1 to 8-4, and the power figures in 8-3. The checks recompute from the CSV already, so only their comments and two hard-coded figures changed.

One exercise changed for real. In 8-3 the design's power rose from about .75 to about .89, so the passing band for power_estimate moved from .67 to .85 up to .83 to .95. "Counted the failures" (.11) and "only 10 students" (.14) now fall too close together to tell apart, so they share one message.

Stress was drawn from an exponential and clipped at 40, which put 190 of
the 5000 students on exactly 40.00. A draw past 40 now wraps back round to
the start of the scale instead. The exponential is memoryless, so the
result is the same skewed shape cut off at 40, with no spike.

The 189 students who changed also get new sleep and exam scores, so every
number Modules 5 to 8 quote from the population was recomputed in R and
updated. The power exercise in 8-3 now passes from .83 to .95, because the
design's power rose from about .75 to about .89.
@PeterSlijkhuis PeterSlijkhuis self-assigned this Oct 8, 2026
@PeterSlijkhuis
PeterSlijkhuis marked this pull request as ready for review October 8, 2026 09:37
@PeterSlijkhuis
PeterSlijkhuis merged commit a2bac35 into main Oct 8, 2026
4 checks passed
@PeterSlijkhuis
PeterSlijkhuis deleted the stress-scale branch October 12, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant