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
3
votes
1 answer

Robust Independent T-test

This is my first time asking a question, so I apologize for any formatting issues or anything that makes this difficult to answer. Please let me know what I need to add to be able to the answer question. I'm attempting to compare differences…
3
votes
2 answers

Why when I run the ggttest there is an error?

When I run the t-test for a numeric and a dichotomous variable there in no problem and I can see the results. The problem is when I run the ggttest of the same t-test. There is an error and says that one of my variable is not found. I do not why…
Katerina
  • 33
  • 6
3
votes
2 answers

How to do a weighted T-test in R?

I have df1: PopDens Score1 Group 93.53455 17.985288 B 137.13861 10.549394 A 35.98619 13.392857 A 89.69800 8.644537 B 16.27796 29.591635 A 25.33346 21.081301 F 89.69800 2.644537 C 46.27796 29.591635 A 25.33346 …
Evan
  • 1,477
  • 1
  • 17
  • 34
3
votes
0 answers

Use pairwise_tukeyhsd compare for all or multiple groups(more than 2)

I have a dataset where I need to perform Tukey_test on multiple variables instead of pair-wise comparison: My data looks like: Subject State Type Success A AZ 1 0.89 B TX 2 0.91 C NJ…
TjS
  • 277
  • 2
  • 5
  • 16
3
votes
0 answers

How to compare the results of different statistical tests?

I don't know if it is a good question or not. Here's the case, say I have a scale/continuous dependent variable and a bunch of independent variables. My ultimate goal is to build a model to predict/estimate the dependent variable using these…
G. Yu
  • 31
  • 1
3
votes
1 answer

simple t-test in python with CIs of difference

What is the most straightforward way to perform a t-test in python and to include CIs of the difference? I've seen various posts but everything is different and when I tried to calculate the CIs myself it seemed slightly wrong... Here: import numpy…
fffrost
  • 1,659
  • 1
  • 21
  • 36
3
votes
2 answers

R: improving speed for t-test for each row in a data frame

I am trying to improve the speed of a t-test loop for a data-frame. I have a large data frame (~15000 rows and 205 columns). Each column is a cell and each row is a gene. I can group the columns into 2 groups based on their identity provided in a…
Son nguyen
  • 29
  • 4
3
votes
2 answers

Multiple t-test comparisons

I would like to know how I can use t.test or pairwise.t.test to make multiple comparisons between gene combinations. First, how can I compare all combinations Gene 1 vs. Gene 3, Gene 3 vs Gene 4, etc.? Second, how would I be able to only compare…
Payton Yau
  • 33
  • 1
  • 4
3
votes
1 answer

How to perform a t-test on data stored in a pandas DataFrame

I have some experimental data. The experiment measured 126 genes over time in three different cell lines with an n=6. The normalized measurement is known as the delta_ct value. The data is stored in a pandas.DataFrame which looks like this: …
CiaranWelsh
  • 7,014
  • 10
  • 53
  • 106
3
votes
0 answers

T-test without omiting NA values in rows

I have a proteomics dataset in which I compare two conditions, and therefore I have condition A (8 replicates) and condition B(9 replicates). In proteomics we don't always have measures for each replicate, but we don't want to eliminate a protein…
3
votes
4 answers

doing t.test for columns for each row in data set

I have a set of data x which consists of 12 columns and 167 rows. The first column is compound Id for each row. I want to run a t.test for 3 column as one group and the other 3 groups as the second group, separately for each row. My code is as below…
leila aghili
  • 41
  • 1
  • 1
  • 4
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
2 answers

Permutation-based alternative to scipy.stats.ttest_1samp

I would like to use a permutation-based alternative to scipy.stats.ttest_1samp to test if the mean of my observations is significantly greater than zero. I stumbled upon scipy.stats.permutation_test but I am not sure if this can also be used in my…
Johannes Wiesner
  • 1,006
  • 12
  • 33
2
votes
2 answers

How to extract lower and upper bounds from confidence level in R from t test function?

I used the following code to retrieve a confidence level for my data: out <- t.test(my_data$my_col, conf.level = 0.95) out This returns something like: data: my_data$my_column t = 30, df = 20, p-value < 2.1e-14 alternative hypothesis: true mean is…
2
votes
1 answer

Vectorize the Mean Value in t.test(x, m = hu) Function Using R

I have a vector in which I want to vectorize a set of hypothesise mean values. This is what I mean, if I have the following: n <- c(10,15,20,25,30,40,50,100,250) # Sample size m <- 100 # Mean of the generated normal variable vv <- 25 …
Daniel James
  • 1,381
  • 1
  • 10
  • 28
1
2
3
32 33