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

I hope Report package can suppport for results of rstatix #111

Open
ChenSD opened this issue Nov 13, 2020 · 3 comments
Open

I hope Report package can suppport for results of rstatix #111

ChenSD opened this issue Nov 13, 2020 · 3 comments
Labels
enhancement 💥 Implemented features can be improved or revised

Comments

@ChenSD
Copy link

ChenSD commented Nov 13, 2020

Describe the solution you'd like
The design concept of Report is exciting. But I think rstatix do ANOVA better than aov or lmerTest packages. I tried using Report for rstatix results and found Report did not support it.

How could we do it?
I hope Report package can suppport for results of rstatix. Maybe we can add the anova method or the package name as an additional input parameter. For example, report(result, aov ) or report(result, rstatix).

@DominiqueMakowski
Copy link
Member

Hi, that makes sense. Essentially in order to support any package by report, its support must first be implemented in insight and parameters, if that's the case (it should be, as @strengejacke will soon be done with R and will start implementing support for packages of the future 😅) ,then it could be quite straightforward. Would you have one reproducible example of a rstatix model as well as the rough output that you think would be good?

@strengejacke strengejacke added the enhancement 💥 Implemented features can be improved or revised label Nov 23, 2020
@IndrajeetPatil
Copy link
Member

I am not sure if it's going to be as straightforward, or even worth it. We have methods to extract effect sizes for htest objects and so it's easy to include all details. This is not going to be the case with rstatix.

library(rstatix)
library(report)

ToothGrowth %>% t.test(len ~ supp, .) %>% report_statistics()
#> difference = -3.70, 95% CI [-0.17, 7.57], t(55.31) = 1.92, p = 0.061; Cohen's d = 0.52, 95% CI [-0.02, 1.05]

ToothGrowth %>% t_test(len ~ supp) %>% report_statistics()
#> Error in names(n_char) <- c("Entry", "n_Entry"): 'names' attribute [2] must be the same length as the vector [1]

Created on 2021-03-18 by the reprex package (v1.0.0)

@genghiskhanofnz
Copy link

The report() does describe the result of rstatix::get_summary_stats().
repex pasted at the bottom.

Totally agree with the ANOVA from rstatix is brilliant.
Would really appreciate if you could show us the desired output from supporting rstatix::anova_test().

library(rstatix)
#> 
#> Attaching package: 'rstatix'
#> The following object is masked from 'package:stats':
#> 
#>     filter

library(flextable)

library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union

iris %>% 
  get_summary_stats() %>% 
  report::report()
#> The data contains 4 observations of the following 13 variables:
#> 
#>   - variable: 4 levels, namely Sepal.Length (n = 1, 25.00%), Sepal.Width (n = 1,
#> 25.00%), Petal.Length (n = 1, 25.00%) and Petal.Width (n = 1, 25.00%)
#>   - n: n = 4, Mean = 150.00, SD = 0.00, Median = 150.00, MAD = 0.00, range: [150,
#> 150], Skewness = , Kurtosis = , 0 missing
#>   - min: n = 4, Mean = 1.85, SD = 1.81, Median = 1.50, MAD = 1.41, range: [0.10,
#> 4.30], Skewness = 0.98, Kurtosis = 0.82, 0 missing
#>   - max: n = 4, Mean = 5.43, SD = 2.44, Median = 5.65, MAD = 2.59, range: [2.50,
#> 7.90], Skewness = -0.35, Kurtosis = -2.60, 0 missing
#>   - median: n = 4, Mean = 3.61, SD = 1.92, Median = 3.67, MAD = 2.08, range:
#> [1.30, 5.80], Skewness = -0.16, Kurtosis = -0.74, 0 missing
#>   - q1: n = 4, Mean = 2.45, SD = 2.04, Median = 2.20, MAD = 1.85, range: [0.30,
#> 5.10], Skewness = 0.64, Kurtosis = 0.20, 0 missing
#>   - q3: n = 4, Mean = 4.15, SD = 2.02, Median = 4.20, MAD = 2.30, range: [1.80,
#> 6.40], Skewness = -0.11, Kurtosis = -1.94, 0 missing
#>   - iqr: n = 4, Mean = 1.70, SD = 1.28, Median = 1.40, MAD = 0.74, range: [0.50,
#> 3.50], Skewness = 1.30, Kurtosis = 2.37, 0 missing
#>   - mad: n = 4, Mean = 1.09, SD = 0.58, Median = 1.04, MAD = 0.44, range: [0.44,
#> 1.85], Skewness = 0.57, Kurtosis = 1.68, 0 missing
#>   - mean: n = 4, Mean = 3.46, SD = 1.92, Median = 3.41, MAD = 1.90, range: [1.20,
#> 5.84], Skewness = 0.17, Kurtosis = 0.87, 0 missing
#>   - sd: n = 4, Mean = 0.95, SD = 0.57, Median = 0.79, MAD = 0.29, range: [0.44,
#> 1.76], Skewness = 1.44, Kurtosis = 2.67, 0 missing
#>   - se: n = 4, Mean = 0.08, SD = 0.05, Median = 0.06, MAD = 0.02, range: [0.04,
#> 0.14], Skewness = 1.45, Kurtosis = 2.66, 0 missing
#>   - ci: n = 4, Mean = 0.15, SD = 0.09, Median = 0.13, MAD = 0.05, range: [0.07,
#> 0.28], Skewness = 1.44, Kurtosis = 2.65, 0 missing

Created on 2023-08-13 with reprex v2.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 💥 Implemented features can be improved or revised
Projects
None yet
Development

No branches or pull requests

5 participants