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

Winsorize based on the MAD #179

Merged
merged 7 commits into from
Jun 27, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
removed tidyr from Suggests, replaced tidyr::pivot_longer with `dat…
…awizard::data_to_long` in vignette
rempsyc committed Jun 26, 2022
commit d45ca3f815b03b6319c417253e336fbf4b9fd10f
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -50,7 +50,6 @@ Suggests:
rmarkdown,
rstanarm,
see,
tidyr,
testthat (>= 3.0.0)
VignetteBuilder:
knitr
25 changes: 12 additions & 13 deletions vignettes/standardize_data.Rmd
Original file line number Diff line number Diff line change
@@ -73,17 +73,16 @@ We can see that different methods give different central and variation values:

```{r, eval=FALSE}
library(dplyr)
library(tidyr)

hardlyworking %>%
select(starts_with("xtra_hours")) %>%
pivot_longer(everything()) %>%
group_by(name) %>%
data_to_long() %>%
group_by(Name) %>%
summarise(
mean = mean(value),
sd = sd(value),
median = median(value),
mad = mad(value)
mean = mean(Value),
sd = sd(Value),
median = median(Value),
mad = mad(Value)
)
```

@@ -113,13 +112,13 @@ hardlyworking_z <- standardize(hardlyworking)
```{r, eval=FALSE}
hardlyworking_z %>%
select(-xtra_hours_z, -xtra_hours_zr) %>%
pivot_longer(everything()) %>%
group_by(name) %>%
data_to_long() %>%
group_by(Name) %>%
summarise(
mean = mean(value),
sd = sd(value),
median = median(value),
mad = mad(value)
mean = mean(Value),
sd = sd(Value),
median = median(Value),
mad = mad(Value)
)
```