-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
unnormalize()
with grouped data
#415
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
@strengejacke if you're ok with this code then I can expand it to |
I'm not sure, but I think @mattansb started with one of the |
Daniel keeps thinking that @DominiqueMakowski 's code is mine 😅 |
The code is still incomplete for |
But see effectsize news, version 0.5.0 |
I'm like 90% certain it was Dom, and then I maintained the code. |
What Daniel says becomes true tho 🤷 |
This comment was marked as outdated.
This comment was marked as outdated.
@strengejacke @DominiqueMakowski or @mattansb I don't know who's the best placed to review but can one of you do it? 😄 |
Last thing, I think we should harmonize the behavior of library(datawizard)
unstandardize(mtcars, "mpg")
#> Error: You must provide the arguments `center`, `scale` or `reference`.
unnormalize(head(mtcars), "mpg")
#> Warning: Can't unnormalize variable. Information about range and/or minimum value
#> is missing.
#> mpg cyl disp hp drat wt qsec vs am gear carb
#> Mazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4
#> Mazda RX4 Wag 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4
#> Datsun 710 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1
#> Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1
#> Hornet Sportabout 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2
#> Valiant 18.1 6 225 105 2.76 3.460 20.22 1 0 3 1 IMO both should fail. @strengejacke do you agree? |
yes. |
Failures due to easystats/insight#804 |
Close #375.
The idea is to store the
dw_transformer
attributes along thegroups
attributes so that we can then recover thedw_transformer
attributes for each group separately. We then need to pass thedw_transformer
attributes tonormalize.data.frame()
and then tonormalize.numeric()
.Same thing for
unstandardize()
.Note: there are probably ways to improve this in terms of performance