Questions tagged [rstatix]

for questions relating to the `rstatix` R package ("Pipe-Friendly Framework for Basic Statistical Tests")

89 questions
3
votes
3 answers

use levene_test in map() function from purrr?

Is there a way to do a Levene Test via the map() function from the purrr package? Or is there another simple way to compute a Levene Test over various variables? My data frame contains various factor and numeric columns, so I tried with map_if(),…
anike
  • 59
  • 5
3
votes
2 answers

Statistical test on multiple variables on multiple lists (tibble)

To simplify my data analysis I need to process different statistical tests (in that example a shapiro test) on different different variables and on different groups of data. The purpose is to not write 150 times the same code. To do that I created,…
C. Guff
  • 418
  • 3
  • 18
2
votes
1 answer

Use `dplyr` to run all pairwise comparisons and add Cohen's *d*

I am using rstatix to perform multiple t-tests on a dataset which works very well, but I also need Cohen's d. rstatix also includes a function to calculate Cohen's d, but it requires the original dataset, not the table generated by the t_test…
Firona
  • 81
  • 2
  • 7
2
votes
0 answers

How can I directly compute a t-test for proportion in R from a data frame using prop_test?

I have a data frame with n > 1000, in which each row includes data for the columns Year, which is a numeric year, and Gender, which is either "Male" or "Female". I want to compute a t-test for the proportion of Gender == "Male" pairwise comparisons…
jp5602
  • 41
  • 5
2
votes
1 answer

How do I perform calculations using the columns of a data table from an ANOVA using the dplyr and rstatix packages?

I have a data frame and have done an ANOVA between the data. After the ANOVA I want to use one of the resulting columns to do a calculation and create a new column with the mutate() function. However, an error appears indicating that this operation…
Daniel Valencia C.
  • 2,159
  • 2
  • 19
  • 38
2
votes
2 answers

How to show Tukey groups using tidyverse and rstatix?

After a Tukey test using rstatix, I would like to add another column to the data frame with the Tukey groups. library(tidyverse) library(rstatix) ggplot(data = iris, aes(x = Species, y = Petal.Length)) + geom_boxplot() Tukey <-…
Daniel Valencia C.
  • 2,159
  • 2
  • 19
  • 38
2
votes
1 answer

Different P-values between wilcox_test() & wilcox.test() in R

While I was trying to perform a paired Wilcoxon test for the variable "Metabolite", I noticed different p-values between wilcox_test() & wilcox.test() when I tested the following variable: structure(list(Visit = structure(c(1L, 1L, 1L, 1L, 1L, 1L,…
Geli
  • 75
  • 5
2
votes
1 answer

Question about the functions `get_test_label` and `get_pwc_label` from the `rstatix` package

I have recently become familiar with the rstatix package. Below is an example code using functions from this package. library(tidyverse) library(rstatix) library(ggpubr) set.seed(1111) n=100 df = tibble( x1 = rnorm(n, 0, 1.1), x2 = rnorm(n,…
blrun
  • 467
  • 3
  • 12
2
votes
1 answer

Problem with 'mutate()' input 'data' in ANOVA (rstatix)

This is driving me crazy. I am using anova_test from rstatix and it's telling me that my columns aren't there when they clearly are. This is what my dataframe looks like: ID = c(1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3) Form = c("A",…
user15141497
  • 73
  • 1
  • 6
2
votes
0 answers

Can I convert an object of class anova_test (rstatix) to an object of class aov, anova, or aovlist?

Some sample data from the DATANOVIA guide on repeated measures ANOVA: library(tidyverse) library(ggpubr) library(rstatix) data("selfesteem", package = "datarium") selfesteem <- selfesteem %>% gather(key = "time", value = "score", t1, t2, t3)…
2
votes
1 answer

R: problems plotting p-values from conover test (Dunn's works fine)

I am having some trouble with an error message I can't solve. I use the following code in to run a Kruskal Wallis in R and then do a pairwise comparison using Dunn's: res.kruskal <- mydata %>% kruskal_test(values ~ group) res.kruskal stat.test <-…
Tyrone
  • 143
  • 1
  • 4
1
vote
1 answer

Hiding NS significance and brackets in R, using geom_pwc, stat_pvalue_manual, or stat_compare_means

I am facing issues with stat_compare_means, geom_pwc, and stat_pvalue_manual. The issues are as follows: stat_compare_means actually works decently for the most part, except for the fact that I cannot seem to get rid of the brackets of NS…
1
vote
1 answer

Run a shapiro_test() within a function based on a dataframe

I have a dataframe with columns Time_points_secs, Treatment and Pellet. I want to test for normality before running statistics and then produce a line graph. I am creating a function so that i can repeat the same code for other columns within the…
JLit98
  • 13
  • 5
1
vote
1 answer

Spread Error in the two-way repeated measure anova test

I am working on a two-way repeated measure anova using the rstatix package. library(rstatix) res.aov <- anova_test(data=kolding, dv=count, wid=id, within=treatment) get_anova_table(res.aov) And here's how the data looks like: id treatment …
1
vote
0 answers

adjusted p value group wise or overall

Recently I met an issue, when I do t.test like below: library(dplyr) library(rstatix) data(ToothGrowth) ToothGrowth%>%group_by(supp)%>%t_test(len~dose) supp .y. group1 group2 n1 n2 statistic df p p.adj *
bioguo
  • 61
  • 4
1
2 3 4 5 6