Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #10 add ard_vif() #61

Merged
merged 31 commits into from
Mar 8, 2024
Merged

Conversation

zdz2101
Copy link
Contributor

@zdz2101 zdz2101 commented Feb 23, 2024

What changes are proposed in this pull request?
added ard_vif() which is essentially a wrapper for car::vif() put into our ard structure

Provide more detail here as needed.

Reference GitHub issue associated with pull request. e.g., 'closes #'


Pre-review Checklist (if item does not apply, mark is as complete)

  • All GitHub Action workflows pass with a ✅
  • PR branch has pulled the most recent updates from master branch: usethis::pr_merge_main()
  • If a bug was fixed, a unit test was added.
  • Code coverage is suitable for any new functions/features (generally, 100% coverage for new code): devtools::test_coverage()
  • Request a reviewer

Reviewer Checklist (if item does not apply, mark is as complete)

  • If a bug was fixed, a unit test was added.
  • Run pkgdown::build_site(). Check the R console for errors, and review the rendered website.
  • Code coverage is suitable for any new functions/features: devtools::test_coverage()

When the branch is ready to be merged:

  • Update NEWS.md with the changes from this pull request under the heading "# cards (development version)". If there is an issue associated with the pull request, reference it in parentheses at the end update (see NEWS.md for examples).
  • All GitHub Action workflows pass with a ✅
  • Approve Pull Request
  • Merge the PR. Please use "Squash and merge" or "Rebase and merge".

@zdz2101 zdz2101 linked an issue Feb 23, 2024 that may be closed by this pull request
tests/testthat/test-ard_vif.R Show resolved Hide resolved
R/ard_vif.R Outdated Show resolved Hide resolved
@zdz2101 zdz2101 marked this pull request as ready for review February 23, 2024 20:08
@zdz2101 zdz2101 requested a review from ddsjoberg February 23, 2024 20:08
Copy link
Contributor

github-actions bot commented Feb 23, 2024

badge

Code Coverage Summary

Filename                    Stmts    Miss  Cover    Missing
------------------------  -------  ------  -------  ------------------------------------
R/ard_car_anova.R              41       2  95.12%   57, 60
R/ard_chisqtest.R              31       0  100.00%
R/ard_cohens_d.R               73       0  100.00%
R/ard_fishertest.R             33       0  100.00%
R/ard_hedges_g.R               60       0  100.00%
R/ard_kruskaltest.R            27       0  100.00%
R/ard_mcnemartest.R            41       0  100.00%
R/ard_moodtest.R               40       0  100.00%
R/ard_proportion_ci.R          40       5  87.50%   63-67
R/ard_proptest.R               71       0  100.00%
R/ard_regression_basic.R       14       1  92.86%   44
R/ard_regression.R             49       0  100.00%
R/ard_smd.R                    40       0  100.00%
R/ard_ttest.R                  78       0  100.00%
R/ard_vif.R                    58       2  96.55%   46, 80
R/ard_wilcoxtest.R             83       0  100.00%
R/proportion_ci.R             188      28  85.11%   275, 278, 287-292, 300, 315, 415-438
TOTAL                         967      38  96.07%

Diff against main

Filename       Stmts    Miss  Cover
-----------  -------  ------  -------
R/ard_vif.R      +58      +2  +96.55%
TOTAL            +58      +2  +0.03%

Results for commit: d48fb3c

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

Copy link
Contributor

github-actions bot commented Feb 23, 2024

Unit Tests Summary

 1 files  29 suites   4s ⏱️
28 tests 20 ✅  8 💤 0 ❌
70 runs  51 ✅ 19 💤 0 ❌

Results for commit d48fb3c.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Feb 23, 2024

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
ard_vif 👶 $+0.02$ $+1$ $+1$ $0$ $0$
Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
ard_vif 👶 $+0.02$ ard_vif_appropriate_errors_are_given_for_model_with_only_1_term
ard_vif 👶 $+0.02$ ard_vif_issues_friendly_messaging_for_incorrect_object_passed_in_can_t_get_terms_of_model
ard_vif 👶 $+0.22$ ard_vif_works

Results for commit 6c743b9

♻️ This comment has been updated with latest results.

@codecov-commenter
Copy link

codecov-commenter commented Feb 23, 2024

Codecov Report

Attention: Patch coverage is 97.95918% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 99.40%. Comparing base (c849ad4) to head (6c743b9).
Report is 3 commits behind head on main.

❗ Current head 6c743b9 differs from pull request most recent head d48fb3c. Consider uploading reports for the commit d48fb3c to get more accurate results

Files Patch % Lines
R/ard_vif.R 97.95% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #61      +/-   ##
==========================================
- Coverage   99.49%   99.40%   -0.09%     
==========================================
  Files          16       17       +1     
  Lines         789      838      +49     
==========================================
+ Hits          785      833      +48     
- Misses          4        5       +1     

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

Copy link
Collaborator

@ddsjoberg ddsjoberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @zdz2101 !! Let me know if you'd like to chat about any of the comments.

DESCRIPTION Outdated Show resolved Hide resolved
R/ard_vif.R Outdated Show resolved Hide resolved
R/ard_vif.R Outdated Show resolved Hide resolved
tests/testthat/test-ard_vif.R Show resolved Hide resolved
R/ard_vif.R Outdated Show resolved Hide resolved
R/ard_regression.R Outdated Show resolved Hide resolved
@zdz2101 zdz2101 requested a review from ddsjoberg February 27, 2024 15:50
R/ard_vif.R Outdated Show resolved Hide resolved
Copy link
Collaborator

@ddsjoberg ddsjoberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great! Just a few comments. Also, can you add tests with non-syntactic names in the covariates? We want to also ensure that the processed non-syntactic names match those from ard_regression().

R/ard_vif.R Outdated Show resolved Hide resolved
R/ard_vif.R Outdated Show resolved Hide resolved
R/ard_vif.R Outdated Show resolved Hide resolved
tests/testthat/_snaps/ard_vif.md Show resolved Hide resolved
R/ard_vif.R Outdated Show resolved Hide resolved
R/ard_vif.R Outdated Show resolved Hide resolved
@zdz2101 zdz2101 requested a review from ddsjoberg March 8, 2024 15:31
@ddsjoberg
Copy link
Collaborator

@zdz2101 thank you for making these updates! I made one small change to the tryCatch() where we were getting the variable names when vif() failed. The tryCatch allowed warnings from terms() to also print to the console, and now we don't see that.

image

Great update!! Thanks!

Copy link
Collaborator

@ddsjoberg ddsjoberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌷 🌷 🌷 🌷 🌷

@ddsjoberg ddsjoberg merged commit e880f74 into main Mar 8, 2024
28 checks passed
@ddsjoberg ddsjoberg deleted the 10-add-variance-inflation-factor-ard branch March 8, 2024 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Variance Inflation Factor ARD
4 participants