Skip to content

Small updates to PR #40#42

Merged
svteichman merged 19 commits into
statdivlab:mainfrom
svteichman:pr-40
Nov 6, 2025
Merged

Small updates to PR #40#42
svteichman merged 19 commits into
statdivlab:mainfrom
svteichman:pr-40

Conversation

@svteichman
Copy link
Copy Markdown
Collaborator

@svteichman svteichman commented Sep 1, 2025

This builds off @shirmath's PR #40. It adds tests of glm_test() with logistic and gaussian models (to see if this addresses the lower code coverage from that PR), and increments the version to denote a minor update.

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 1, 2025

Codecov Report

❌ Patch coverage is 89.36170% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.86%. Comparing base (aaf92ec) to head (a8b5731).
⚠️ Report is 29 commits behind head on main.

Files with missing lines Patch % Lines
R/V_matrix_contribution.R 83.33% 3 Missing ⚠️
R/D_matrix_contribution.R 85.71% 1 Missing ⚠️
R/gee_test.R 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #42      +/-   ##
==========================================
+ Coverage   87.43%   87.86%   +0.43%     
==========================================
  Files          23       26       +3     
  Lines         748      783      +35     
==========================================
+ Hits          654      688      +34     
- Misses         94       95       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@svteichman
Copy link
Copy Markdown
Collaborator Author

@shirmath this PR takes yours and adds tests to increase code coverage (also simplifies function for Si matrix and updates Di matrix function to not hit matrix multiplication error for clusters with size 1). I think this is all set, conditional on the question I noted on your PR #40, about n-p vs n-1 in the denominator for the Gaussian sigma2_tilde.

@svteichman
Copy link
Copy Markdown
Collaborator Author

@shirmath Do you mind reviewing this PR when you get the chance, to make sure that all of my updates make sense to you?

@shirmath
Copy link
Copy Markdown
Contributor

@svteichman Why does the denominator cancel out in the test statistic in the Gaussian case? All the changes made sense to me outside of that

@adw96
Copy link
Copy Markdown
Contributor

adw96 commented Sep 15, 2025 via email

@svteichman
Copy link
Copy Markdown
Collaborator Author

@adw96 this should be all set to review and merge when you get the chance!

@adw96
Copy link
Copy Markdown
Contributor

adw96 commented Nov 5, 2025

This is excellent, @shirmath and @svteichman -- well done!! This is clear, well-designed, modular code. I think this will flourish as an R package 😻

One minor thing I noticed (that don't need to be addressed to merge) is that (family == "binomial" & link == "logit") isn't tested, reducing coverage a little. If it's easy to add a test, that'd be awesome.

Regardless, feel free to merge when ready!

@svteichman
Copy link
Copy Markdown
Collaborator Author

@adw96 I think that a test with binomial family & logit link is in "test-basic.R" lines 51-61. Is this the kind of thing you were hoping for?

test_that("test logistic example", {
  
  expect_type(glm_test((dist > 43) ~ speed, data = cars, family=binomial(link = "logit"))$coef_tab,
              "double")
  
  cars$id <- c(rep(1:5, 9), 6:10)
  expect_type(gee_test(formula = (dist > 43) ~ speed, data = cars, id = "id", 
                       family=gaussian(link = "identity"))$coef_tab,
              "list")
  
})

@adw96
Copy link
Copy Markdown
Contributor

adw96 commented Nov 5, 2025

weird!! covr shows me this

Screenshot 2025-11-05 at 1 33 25 PM

so... please ignore my concern 😊

@svteichman svteichman merged commit 76ede7a into statdivlab:main Nov 6, 2025
6 checks passed
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.

3 participants