Questions tagged [rstatix]

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

89 questions
1
vote
2 answers

Normality test for multi-grouped data in R

I'm trying to run a normality test over my data in R. My dataset is a data frame formed by 4 columns of characters and one column with numeric values. At the moment, I'm using the Rstatix package in R and other types of statistical tests are working…
1
vote
1 answer

Replacing loop to do T-test in R

I have a dataframe with the following structure: set.seed(1) dat<- data.frame(gender=sample(rep(c("Man","Woman"),3000)), age=sample(rep(c("Young","Old"),3000)), question=rep(c("Q1", "Q2", "Q3"),2000), …
cholo.trem
  • 314
  • 2
  • 9
1
vote
2 answers

T-test with column number instead of column name

I am trying to perform a series of T-tests using RStatix's t_test(), where the dependent variable is the same in every test and the grouping variable changes. I am doing these tests inside a loop, so I would like to select the grouping variable with…
cholo.trem
  • 314
  • 2
  • 9
1
vote
1 answer

T-test() does not add adjusted p-values

I have a survey that was conducted in 3 different classes (math, phys, bio) at the beginning and at the end of the semester (pre and post). In the survey, there were 3 groups of questions (A, B, C) and a Likert-type scale. I converted all the…
yuliaUU
  • 1,581
  • 2
  • 12
  • 33
1
vote
1 answer

Row-wise Fisher Exact Test, grouped by samples in R

Consider the following dataframe: df1 # bacteria sample Number_x Number_y #1 A HM_001 100 30 #2 B HM_001 50 60 #3 C …
JujutsuR
  • 81
  • 6
1
vote
0 answers

In a facet_grid call how can I remove one aesthetic from the margin = T (all the values of the other panels together?)

So, I am calculating a statistic between two values, one random and the other one "real" scores. As it is sort of paired, I plot the distributions of the differences for different conditions and states with facet_grid but I am also interested in the…
Garini
  • 1,088
  • 16
  • 29
1
vote
2 answers

How to map over dataframe, is it a tidyeval error?

Want to map over columns in a dataframe & perform t-tests with each column against a fixed column. Desired output would be a dataframe with each row(s) being t-test results - can use map_dfr once mapping process ok Dug into tidy eval, not sure if…
Brent
  • 425
  • 1
  • 3
  • 10
0
votes
0 answers

How to solve error related to anova_test function in rstatix

I am running the following repeated measure ANOVA on such data anova_test(data, + dv = dv, + wid = ID, + within = R, + detailed = TRUE, + between = Sex, + type = 3) But I am…
12666727b9
  • 1,133
  • 1
  • 8
  • 22
0
votes
0 answers

Can I include covariates in a one-way repeated measures ANOVA? (ANCOVA?) What do results tell me?

I want to test the effect of a suicide prevention film on help-seeking. I have help-seeking intentions as an outcome variable and measured this variable at three time points (pre, post, follow-up) in 50 participants. To analyse the data I would…
0
votes
1 answer

Difficulty with user-defined function to perform operation on multiple variables in R

I am doing t-tests on variables within a dataframe: library(rstatix) df <- data.frame(grouping = c(rep("left", 50), rep("right", 50)), var1 = (rnorm(100, mean=21, sd=3))) var1_result <- df %>% t_test(var1 ~ grouping, paired =…
marcel
  • 389
  • 1
  • 8
  • 21
0
votes
1 answer

ggpubr missing significance annotations

I would like to get a barplot with significance annotations. I am using the following three libraries: tidyverse, ggpubr, rstatix, and reprex. I am using the dataset and code in this gist, just copy and paste and you have all you need:…
falco
  • 3
  • 2
0
votes
1 answer

Error message when using anova_test() - Error in str2lang(x) : :1:8: unexpected input 1: cbind(1_

When running previously working code with new data I get the following error: res.aov <- anova_test( data = c1_l1, dv = value, wid = Month, within = c(buffer, TimePeriod), effect.size = "ges", detailed = TRUE, ) # Error in str2lang(x) :…
strangecharm
  • 186
  • 11
0
votes
0 answers

anova_test (rstatix) Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : 0 (non-NA) cases

I am trying to conduct a two-way repeated measures ANOVA using the dataset below (df2): # A tibble: 20 × 5 `Lateral Preference` Student `1st Grade` `2nd Grade` `3rd Grade` 1…
0
votes
1 answer

fisher exact test for 2 consecutive rows in data frame R

i have data frame where for a 1 site i have tumor and normal count data. I want to do fisher exact test using the count_unmethylated and count_methylated for tumor and normal for each position chromosome start end. so for the first…
sahuno
  • 321
  • 1
  • 8
0
votes
2 answers

fisher exact using tidyr or dplyr approach

I have data dataframe with two groups, Tumor and Normal. for each site/row i want calculate fischer exact for using Methyl UnMethy between Tumor and Normal I'm looking for how to transform data to calculate fisher exact for each site using dplyr…
sahuno
  • 321
  • 1
  • 8