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

Add n #64

Merged
merged 37 commits into from Dec 8, 2020
Merged

Add n #64

merged 37 commits into from Dec 8, 2020

Conversation

larmarange
Copy link
Owner

@larmarange larmarange commented Oct 20, 2020

Exploratory and experimental PR

Not to be considered for merging at this stage

  • add tests for a wide range of models
  • integration in tidy_plus_plus()
  • finalize documentation
  • finalize examples in documentation
  • update vignette
  • update NEWS

@larmarange larmarange added exploratory For testing purpose enhancement New feature or request labels Oct 21, 2020
@larmarange larmarange marked this pull request as draft October 21, 2020 16:31
@larmarange larmarange marked this pull request as ready for review December 3, 2020 13:16
@larmarange
Copy link
Owner Author

Dear @ddsjoberg

tidy_add_n() is ready for review if you want to test it.

Cheers

@ddsjoberg ddsjoberg self-requested a review December 3, 2020 13:58
@ddsjoberg
Copy link
Collaborator

Dear @ddsjoberg

tidy_add_n() is ready for review if you want to test it.

Cheers

Awesome! I'll take a look!

@ddsjoberg
Copy link
Collaborator

@larmarange I've been playing around with this and it's perfect. I'll do some more testing. The only thing I would add is more details to the description "Add the number of observations in a new column n taking into account interaction terms and the different types of contrasts." I would add what numbers it adds for continuous, categorical, and dichotomous data. What will be reported for various contrasts, etc.

@larmarange
Copy link
Owner Author

Dear @ddsjoberg

I have developed the documentation of tidy_add_n(). I'm not sure if it is clear and I would appreciate an external look at it.

Best

@larmarange
Copy link
Owner Author

Small question: what should be the default value for add_n in tidy_plus_plus()? TRUE or FALSE? As it is not changing the structure of the results (just additional columns), it's maybe worth to be TRUE by default (for simplicity for final users)?

@ddsjoberg
Copy link
Collaborator

Small question: what should be the default value for add_n in tidy_plus_plus()? TRUE or FALSE? As it is not changing the structure of the results (just additional columns), it's maybe worth to be TRUE by default (for simplicity for final users)?

I think that is a great idea! I don't think it would cause any issues downstream.

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.

hey hey, the update looks fantastic! I tried to break it in various ways, and it always performed perfectly.

There is just one thing I am requesting to be changed. The new columns added "n" and "nevent" are used in gtsummary already after add_nevent(). I know that users go into .$table_body and futz with these columns, and it would be helpful to avoid changes that break their code. What do you think about "nobs" and "nobs_event" (or anything else really!)?

@larmarange
Copy link
Owner Author

There is just one thing I am requesting to be changed. The new columns added "n" and "nevent" are used in gtsummary already after add_nevent(). I know that users go into .$table_body and futz with these columns, and it would be helpful to avoid changes that break their code. What do you think about "nobs" and "nobs_event" (or anything else really!)?

Do you think they could be a confusion between the columns created by broom.helpers and those created by gtsummary::add_nevent()? Somehow, is it redundant?

We can change the names in broom.helpers. Would maybe prefer n_obs and n_event.

Regards

@codecov
Copy link

codecov bot commented Dec 8, 2020

Codecov Report

Merging #64 (dfd1852) into master (0ba57c4) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            master       #64    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           27        33     +6     
  Lines         1154      1336   +182     
==========================================
+ Hits          1154      1336   +182     
Impacted Files Coverage Δ
R/helpers.R 100.00% <ø> (ø)
R/broom.helpers-package.R 100.00% <100.00%> (ø)
R/model_compute_terms_contributions.R 100.00% <100.00%> (ø)
R/model_get_model_matrix.R 100.00% <100.00%> (ø)
R/model_get_n.R 100.00% <100.00%> (ø)
R/model_get_offset.R 100.00% <100.00%> (ø)
R/model_get_response.R 100.00% <100.00%> (ø)
R/model_get_weights.R 100.00% <100.00%> (ø)
R/tidy_add_n.R 100.00% <100.00%> (ø)
R/tidy_add_reference_rows.R 100.00% <100.00%> (ø)
... and 7 more

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.

Looks amazing. Love the update

@larmarange larmarange merged commit a396dc7 into master Dec 8, 2020
@larmarange larmarange deleted the add_n branch December 6, 2021 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request exploratory For testing purpose
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants