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
1
vote
1 answer

Wrong results in calculating boxplot significance levels in R

I am working on creating a basic boxplot with significance level bars (as showed here: How to draw the boxplot with significant level?) The data I use is as…
Mauro
  • 13
  • 2
1
vote
1 answer

Performing t-test on individual rows

hoping for a bit of help with something that should (hopefully) be easy enough for those with the knowledge. I am working with a dataset with 111 columns and 300 rows. The first 70 columns are control data, columns 71-111 contain data on people with…
billroggio
  • 27
  • 3
1
vote
1 answer

How to get t and p-value in two sample t-test on two means, but the hypothesis is the mean of both have difference of a particular number?

I have two dataframes of samples both are from different populations (df1 and df2) I am trying to get the t and p-value. Here's what I have done: In [1]: import scipy.stats as stats stats.ttest_ind(a=df1, b=df2) Out [1]:…
sempraEdic
  • 132
  • 9
1
vote
1 answer

How to create dataframe with p-values from a t-test loop across columns in r?

I have two matrices of values for two cohorts across 166 columns representing days (e.g. Day1). condition_1 Day1 Day2 Day3 ... Day166 person1 27 38 94 40 person2 69 16 85 47 person3 99 30 90 50 person4 69 88 …
1
vote
1 answer

Why is my independent t-test different in SPSS or Excel?

I want to compare the output of my simulation model to the observed data in various ways, like using an independent t-test to compare the means. However, when I do the independent t-test in SPSS, I get a different result than the independent t-test…
Ella
  • 125
  • 6
1
vote
1 answer

How to obtain t-statistics and p-values for correlations between 4 lists

My aim is to calculate the t-statistics and p-value for the following comparison: Four lists of data (Core_R, Core_T, Periphery_R, Periphery_T) The correlation between two lists is computed, respectivley: correlation Core_R and Core_T; correlation…
Philipp
  • 335
  • 2
  • 4
  • 12
1
vote
0 answers

How to do a one-sample location, two-way approximate Z test in R using estimates from the delta method?

I used the delta method to estimate the difference between two coefficients from a glm fit (attached code below). Now, I want to compare this estimate to zero (i.e., a null hypothesis of no difference). One article mentions using a one-sample…
Rspacer
  • 2,369
  • 1
  • 14
  • 40
1
vote
1 answer

Perform independent samples t-test

I have a dataset that looks like this Id age memory_score 1 young 71.11172 2 old 67.65542 3 young 65.34716 4 young 81.21345 5 old 80.72106 6 …
Erdem Akca
  • 41
  • 5
1
vote
2 answers

How to reverse the group comparison order for t.test()?

I would like to conduct a two-sample independent t-test and my grouping variable, "group" is factored as '0' and '1'. When calling the t.test(), it calculates the difference as mean for group 0 - mean for group 1, giving me a negative difference and…
Cassandra
  • 137
  • 1
  • 9
1
vote
0 answers

Reasoning for numpy random seed in this function?

I'm following a tutorial on the usage of Python in bioinformatics. In the tutorial a Mann-Whitney U test was performed via the function below. numpy.random.seed was used in the first line after packages but nowhere else. I was wondering what is the…
1
vote
1 answer

T test for two lists of matrices

I have two lists of matrices (list A and list B, each matrix is of dimension 14x14, and list A contains 10 matrices and list B 11) and I would like to do a t test for each coordinate to compare the means of each coordinate of group A and group B. As…
baptbapt
  • 23
  • 3
1
vote
1 answer

Can t-test be calculated on large samples with non-normal distribution?

Can t-test be calculated on large samples with non-normal distribution? For example, the number of users in group A is 100K, the number of users in group B is 100K. I want to test whether the average session duration of these two groups is…
1
vote
1 answer

Is there a way to conduct one tailed t-test using add_p or add_difference function in tbl_summary?

I wanted to include the results of one-tailed t-test using gtsummary. Is there a way to do this?
1
vote
2 answers

How to calculate Cohen's D across 50 points in R

I have the following DF: structure(list(AgeGroup = structure(c(1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L,…
CanyonView
  • 401
  • 3
  • 15
1
vote
2 answers

Multiple comparisons using perm.t.test on grouped variables

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 permutation t-tests and Mann-Whitney tests on my data grouped for different variables. For examples,…
Valen78
  • 115
  • 6