-
-
Notifications
You must be signed in to change notification settings - Fork 39
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 normal and wald types #648
Conversation
Codecov Report
@@ Coverage Diff @@
## main #648 +/- ##
==========================================
+ Coverage 54.32% 54.98% +0.65%
==========================================
Files 119 124 +5
Lines 14101 14334 +233
==========================================
+ Hits 7661 7881 +220
- Misses 6440 6453 +13
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
R/get_df.R
Outdated
#' - `"wald"` for models with z-statistic, returns `"Inf"`. Else, tries to | ||
#' extract residual degrees of freedoms. If residual degrees of freedom could | ||
#' not be extracted, returns `"Inf"`. | ||
#' - `"analytical"` returns analytical degrees of freedom, i.e. `n-k` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference between residual and analytical? They sound the same to me from this description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
analytical is always n_obs() - n_param()
(n-k). not sure if which cases this may differ from residual df?
Co-authored-by: Brenton M. Wiernik <bwiernik@users.noreply.github.com>
…nto get_df_typey
@bwiernik @mattansb what should "analytical" df return for models with z-statistic? Still
|
I think the only issue is that residual is poorly described. It's whatever the model returns as the df, whereas analytical is always exactly n - params. |
Should we be more strict/consistent here? |
I think analytical and residual df are actually the same, so maybe we should simplify this. Then we would have
|
For some models it depends how you define "number of parameters" - thinking of mixed models. If I have 1000 obs from 10 subjects and Something to think about? |
Usually,
parameters::degrees_of_freedom()
andinsight::get_df()
are expected to do the same thing. However, currently the design of those two functions differ.parameters::degrees_of_freedom()
offers more options to extract df's. This PR aims at bringinginsight::get_df()
on par withparameters::degrees_of_freedom()
, so the latter can be fully replaced byinsight::get_df()
. I think it doesn't make sense and is rather confusing to have two methods which do different things for certain models.@easystats/core-team