Questions tagged [rstatix]

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

89 questions
1
vote
1 answer

Error running two way mixed model ANOVA in loop but not when column of data specifically identified

This is the loop that is generating the error. Error: ! Can't subset columns with df_numeric[[column]]. ✖ Can't convert from df_numeric[[column]] to due to loss of precision. df_numeric <- df[, sapply(df, is.numeric)] for (column in…
swats15
  • 15
  • 3
1
vote
2 answers

In the rstatix function anova_test, how do I get both ges and pes as effect sizes?

It says here that one can get one or the other or both. I have been able to get each one separately but not both together even when I set effect.size = c("ges", "pes"). Instead, I only get "pes". I have the same problem when I use my own data and…
curious
  • 23
  • 5
1
vote
0 answers

Is there a version of add_y_position that can be used outside of rstatix to autocalculate y positions for a plot

I'm making a bar chart, and want to add lines for p-values of pairwise comparisons of the x axis groups. I want to automatically assign the y positions of these horizontal p-value lines, in the same way as add_y_position() does. Here is how to do it…
Mike
  • 921
  • 7
  • 26
1
vote
2 answers

make nice simple t-test (difference in means) table that can be exported to latex in R

The biggest problem with using methods such as through library(broom) library(dplyr) library(broom) output <- iris %>% group_by(Species) %>% summarise(tidy(t.test(Sepal.Width))) Is that it produces a tibble which is essentially a glorified…
1
vote
0 answers

How to specify covariates that don't interact with factors when using rstatix package?

When adding covariates to a between-subjects ANOVA model specified using rstatix package syntax, can one specify these covariates as having no interaction with the main effects? For example, results from running the "RUN1" code below results in both…
JoeyyyFunk
  • 70
  • 7
1
vote
1 answer

Running Levene's test for each column of a df in R

I have a data frame containing scores of several sub-scales of the same test (columns: participant, session, group, total score, one column per sub-scale). I am trying to run assumption checks for a two-way mixed ANOVA for each sub-scale. For…
soph
  • 25
  • 2
1
vote
1 answer

How to implement "broom" package in R

I have an issue that might be silly in some ways, but following this question: Linear Regression and group by in R I tried to install the broom package in order to "retrieve the coefficients and Rsquared/p.value". I know that the previous question…
Recology
  • 165
  • 1
  • 10
1
vote
1 answer

Identifying several variable outliers with rstatix

Here is the dput for the data I have. I have only included the head of the data because this is a pretty massive dataset, but I think it should suffice given my question: structure(list(Prioritising.workload = c(2L, 2L, 2L, 4L, 1L, 2L),…
Shawn Hemelstrand
  • 2,676
  • 4
  • 17
  • 30
1
vote
1 answer

How do I get gt table to work with get_summary_stats

Dataset Here is the dput head for my dataset: structure(list(Year = c("2021", "2021", "2021", "2021", "2021", "2021"), Month_Number = c("9", "9", "9", "9", "9", "9"), Month_Name = c("September", "September", "September", "September", "September",…
Shawn Hemelstrand
  • 2,676
  • 4
  • 17
  • 30
1
vote
2 answers

Cohens_d error due to non-numeric vector...but where is it?

I am getting the following error: Error: Cannot compute effect size for a non-numeric vector. When I try to calculate cohens_d (RStatix) in R Studio using this code: > # Calculate (Cohen's D) effect size > Cohen <- LST_Weather_dataset %>% + …
strangecharm
  • 186
  • 11
1
vote
0 answers

reposition significance brackets in order of comparisons stat_pvalue_manual ggplot2

I have a histogram I created in ggplot2 and added pairwise comparisons with adjusted p-values using the stat_pvalue_manual function from ggpubr. pwc <- df_melt %>% wilcox_test(value ~ variable, paired = TRUE, p.adjust.method = "holm") ggplot(df,…
becbot
  • 151
  • 1
  • 2
  • 9
1
vote
2 answers

How to identify and remove outliers in a data.frame using R?

I have a dataframe that has multiple outliers. I suspect that these ouliers have produced different results than expected. I tried to use this tip but it didn't work as I still have very different values:…
wesleysc352
  • 579
  • 1
  • 8
  • 21
1
vote
2 answers

Trouble with formula in rstatix::dunn_test

I wrote a function to parse the data.frame and it was throwing an error with rstatix::dunn_test which I cannot solve. This is because variable names are incorrect passed to the…
VoronDM
  • 33
  • 4
1
vote
1 answer

How to select groups with data that can be compared within multiple groups (using dplyr and rstatix)?

I want to run t-tests by gender within groups. I have two group variables (group_1 and group_2) and multiple outcome variables (var1 and var2 - though in my dataset I have many variables). …
Armags
  • 53
  • 6
1
vote
1 answer

R - pairwise_t_test Test Statistics Unchanged When Switching Between Pooled Standard Deviation and non-Pooled Stardard Deviation

While reviewing pairwise t-tests as a post hoc for one way repeated measures ANOVA I noticed an oddity. The test statistic for pair_t_test in the rstatix library does not change when I pool the standard deviation -- in fact none of the output…
Englishman Bob
  • 377
  • 2
  • 13