Repository navigation
Test that duplicated rows sharing an id keep their standard errors - #73
Merged
Merged
Conversation
Two copies of each row under a shared id carry no more information than one, so the intervals should match the original data's (issue #18). A unit test checks that cv_cluster_var() doubles exactly when n doubles, one- and two-way, and an end-to-end test checks that varimpact() keeps the interval widths with id and narrows them by about sqrt(2) without. Closes #18 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UcpuhTnMKP8W19CLUUyU2T
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #73 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 32 32
Lines 2618 2618
=========================================
Hits 2618 2618 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ck37
pushed a commit
that referenced
this pull request
Oct 12, 2026
Release version with today's date, and the NEWS heading for everything since 1.2.4, including cluster-robust standard errors (#71, #72, #73). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UcpuhTnMKP8W19CLUUyU2T
ck37
pushed a commit
that referenced
this pull request
Oct 12, 2026
Release version with today's date, and the NEWS heading for the changes recorded since NEWS.md was started in 2025, including cluster-robust standard errors (#71, #72, #73). The old "1.2.4" NEWS heading never matched a DESCRIPTION version, which went from 1.2 to 1.3 in January 2017 and has been a 1.3.0 development version since, so it now reads 1.3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UcpuhTnMKP8W19CLUUyU2T
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the check proposed in #18 for the
idargument merged in #71 and #72: two copies of each row, sharing an id, carry no more information than one, so the standard errors should match the original data's. Tests only; no package code changes.test-cluster-var.R: copying every row within its cluster doublescv_cluster_var()exactly, so the standard errorsqrt(variance / n)is unchanged. Checked one-way (site) and two-way (site and school, crossed).test-varimpact-cluster.R: end to end on 200 independent rows, each duplicated. Withid, the interval half-widths stay within 30% of the original data's; withoutidthey are at least 30% narrower than with it. Across five data seeds the ratios were 0.92-1.21 withidand 1.39-1.8 without, against the √2 ≈ 1.41 shrinkage the issue expected. The test takes about 13 seconds.Point estimates are not compared: with
idthe folds differ, and so can each variable's data-adaptive low and high levels.Both changed test files pass locally (91 and 68 expectations).
Closes #18
🤖 Generated with Claude Code
https://claude.ai/code/session_01UcpuhTnMKP8W19CLUUyU2T
Generated by Claude Code