Add compute_icc() for calculating intraclass correlation from clustered designs#492
Draft
Add compute_icc() for calculating intraclass correlation from clustered designs#492
Conversation
Co-authored-by: kaiemjoy <16113030+kaiemjoy@users.noreply.github.com>
Co-authored-by: kaiemjoy <16113030+kaiemjoy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Move compute_icc() function to new PR
Add compute_icc() for calculating intraclass correlation from clustered designs
Jan 21, 2026
Codecov Report❌ Patch coverage is
|
Member
|
fix issues identified by failing workflows |
Member
|
…te pkgdown index, wrap examples in dontrun Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Contributor
Author
Fixed all workflow failures in commit bc03f0b:
|
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.
Description
Extracts
compute_icc()function fromcopilot/adjust-seroincidence-likelihoodinto standalone PR. Computes Intraclass Correlation Coefficient (ICC) for seroincidence estimates using design effect (DEFF) method: ICC = (DEFF - 1) / (m̄ - 1), where DEFF is the ratio of cluster-robust to standard variance.Note: Examples are wrapped in
\dontrun{}as the clustering functionality (cluster_varparameter) is not yet available in the main branch. The function is ready to use once clustering support is merged.Changes
Core functionality:
compute_icc.R- S3 generic with methods forseroincidenceandseroincidence.byobjectscompute_icc_single.R- Internal ICC computation for single estimatescompute_cluster_robust_var.R- Sandwich variance estimator for clustered dataicc_single_to_df_row.R- Helper for stratified result formattingOutput methods:
print.icc_seroincidence.R- Formatted output with clustering diagnosticsprint.icc_seroincidence.by.R- Stratified results as tibbleDocumentation:
\dontrun{})compute_icc+ 5 S3 methodsConfiguration:
Example Usage
-for NEWS.md inclusionOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.