Questions tagged [t-test]

Related to statistical hypothesis testing. Most software packages used for statistical analysis (including R) provide functions for performing the t-test. Use this tag for questions related to the t-test.

The t-test is also known as the "Student's t-test" after the pseudonym of its inventor. It is used for comparing the means of two samples, or the mean of one sample (or even parameter estimates) with a specified value. See the Wikipedia article for more details. Refer to the R documentation for details on the t.test function arguments and return values.

494 questions
0
votes
1 answer

How to plot p-value over time using ggplot2?

So I have some data which looks like this: DATE GROUP Value Visitors 2021-01-01 Treatment 12 40 2021-01-01 Control 4 43 2021-01-02 Treatment 7 34 2021-01-02 Control 2 39 2021-01-03 Treatment 10…
John Thomas
  • 1,075
  • 9
  • 32
0
votes
0 answers

Disable scientific notation in t_test of rstatix package

I want to use to following exampe to do t-tests with multiple variables - The code is used from https://www.datanovia.com/en/blog/how-to-perform-multiple-t-test-in-r-for-different-variables/: options(scipen = 99) # Load required R…
MDStat
  • 355
  • 2
  • 17
0
votes
1 answer

Statistical significance test after matching

I have a dataframe consisting of four columns and around 20000 rows, like this. import pandas as pd import numpy as np d = {'x': [1,1,0,1,0,0,1],'BPM':[70,55,45,np.nan,35,25,np.nan],'AGE': [50, 47,21, 50,24,47,16], 'WEIGHT':…
0
votes
1 answer

Why does t-test return nan/pandas python

df: gender order F 1 F 1 M 1 F 1 M 1 F 1 Aim: To check if the mean of F and M are significantly different. I want to check if there is a significant difference between females and males for order 1.…
SaNa
  • 333
  • 1
  • 3
  • 13
0
votes
0 answers

t-test on R with multiple grouped variables

I have a dataset like…
katdataecon
  • 185
  • 8
0
votes
0 answers

ttest mean differs from mean value in R

I want to check whether the purchase intention of a product is affected by a label. I did a t-test t.test(myfile$Purch_Int~myfile$Product) and got mean in group 0 = 3.757 mean in group 1 = 3.883 but when I ask for the mean myfile[Product== 1,…
0
votes
1 answer

Two Tailed and One Tailed T Test in R

Histogram Dataset Boxplot Above is the data and some overview of how it looks. I want to use a t test to find if the mean width between 2 samples from the same population are different (2 Tailed). More specifically, I am interested if the mean width…
Boss Boyd
  • 53
  • 2
  • 6
0
votes
1 answer

t-test in r for different categories

I have a dataset with 26 variables and 4662 observation over one year. I want to analyse differences which may occur after a specific date. There is the variable time which is 0 if it is before the date and 1 if it is after. Another variable…
Paul
  • 23
  • 5
0
votes
1 answer

Paired T-Test over multiple paired columns (wide data format)

I've converted a data frame into wide format and now want to compute paired t-tests to obtain p-values. I have managed to do this for each pair of columns individually, but it's a lot more code than I feel is necessary. I'm still very new to R, data…
Dee G
  • 133
  • 9
0
votes
0 answers

How to test normal distribution of a variable

I have two data sets: 1st scenario: I measured one metabolite, and I want to test if it is normally distributed to perform a T-test or a non-parametric test. N1 subjects took drug1, and I measured the metabolite and N2 subjects took drug2, and I…
Geli
  • 75
  • 5
0
votes
0 answers

Chi-squared test for single sample variance in r

I am supposed to make a single sample test and answer with a<0.05 about the variance of the sample. But I'm not really sure how to get it from single sample. I tried something like this variance <- 0.0001 sample <- c(8.99, 9.01, 8.98, 9.00,…
WPHakoon
  • 1
  • 1
0
votes
1 answer

Why my p.value distribution of t-test compairing same distribution is not homogenous?

I was watching the Statquest video about Independent filtering and I wanted to recreate his example. https://www.youtube.com/watch?v=Gi0JdrxRq5s&t=208s So basicaly he made two tests: In one, he performed 1,000 t-test where he compared triplicates…
0
votes
1 answer

Multiple paired permutation t-tests using perm.t.test

I have some data from an experiment to analyse with R but I have a problem and after days of search, I can't find a solution. I need to run multiple paired permutation t-tests on my data. This is a reduced version of my dataset: treat =…
Valen78
  • 115
  • 6
0
votes
2 answers

Using combn() in R to find all possible t-test relationships, how to access the variables compared?

So, I have a DataFrame with a large number of variables, and I want to cross-check each variable with each other variable with a t-test. A sample of my data, called…
0
votes
1 answer

I have created a boxplot, but I need to make it APA style

this is the code and data i already have: library(tidyverse) t.test(BMIS ~ CONDITION, var.equal =TRUE, data = BMIS_DATA) descriptive_statistics = BMIS_DATA %>% group_by(CONDITION) %>% …
Iesha Tucker
  • 3
  • 1
  • 3