Questions tagged [t-test]

A test for comparing the means of two samples, or the mean of one sample (or even parameter estimates) with a specified value; also known as the "Student t-test" after the pseudonym of its inventor.

A statistical test is a t-test, if it meets the following criteria: (1) It compares a sample statistic to a reference value, (2) divides the difference by a standard error, (3) whose variance is estimated from the same data (i.e., there is some uncertainty about its value), and (4) has a result that is distributed as t. The prototypical example of a t-test is comparing the means of two samples, for example: $$ t=\frac{\bar X_1-\bar X_2}{\sqrt{s^2_\text{pooled}\left(\frac{1}{n_1}+\frac{1}{n_2}\right)}} $$ This specific example applies only to cases where the variances are equal, the samples are independent, and the reference value is $0$. However, the t-test is broader; there are versions that address single samples, specified reference values, unequal group variances, and dependent samples. The t-test is also used in other settings, such as to assess parameter estimates (i.e., $\hat\beta$s) in linear models.

3674 questions
16
votes
1 answer

Two-sample T-test with weighted data

I want to perform a two-sample T-test to test for a difference between two independent samples which each sample abides by the assumptions of the T-test (each distribution can be assumed to be independent and identically distributed as Normal with…
15
votes
4 answers

How to perform t-test with huge samples?

I have two populations, One with N=38,704 (number of observations) and other with N=1,313,662. These data sets have ~25 variables, all continuous. I took mean of each in each data set and computed the test statistic using the formula t=mean…
ayush biyani
  • 1,617
9
votes
4 answers

Welch's t-test gives worse p-value for more extreme difference

Here are four different sets of numbers: A = {95.47, 87.90, 99.00} B = {79.2, 75.3, 66.3} C = {38.4, 40.4, 32.8} D = {1.8, 1.2, 1.1} Using a two-sample t-test without assuming equal variances, I compare B, C, and D to A and get the following…
ALiX
  • 330
5
votes
2 answers

Paired t-test and two-sample t-test

I have a simple question regarding the use of paired t-test and two-sample t-test: What is the consequence of using the independent two-sample t-test for dependent paired samples? What is the consequence of using the paired t-test for independent…
alittleboy
  • 1,013
5
votes
1 answer

paired t-test with ordinal data

Can I do a paired samples t-test when my data are ordinal? My data are reading levels at time 1 and time 2, but the data levels are A, 1 2,3,4,6,8,10, 12, 14, 20, 24, 28, 30, 34, 38, 40, 50, 60, 70, 80. They appear to be continuous but they are not.…
Lynette
  • 51
5
votes
2 answers

Is a t-test between a dataset and its subset meaningful

I have two data sets A and B. B is a subset of A. Is it meaningful to test if A and B are significantly different with t-test?
4
votes
2 answers

1-sided two sample t-test with covariate adjustment

I have a biological problem which involves using a 1-sided two-sample t-test. To simplify the problem, let’s assume an experiment comparing quantities in a control (C) and a treatment (T) group, each having 3 replicates, called C1, C2, C3, T1, T2,…
alittleboy
  • 1,013
4
votes
3 answers

Standard deviation larger than mean

I am trying to test if there has been a significant change in the weight of two groups, one without exercise and one with exercise. The two samples have large spread, which creates a standard deviation that is larger than the mean for each group.…
4
votes
1 answer

Why does a t-test on similar random samples often come out with a small p-value?

Running the following Python code, I often get very small p-values, sometimes even around 0.01. a, b = np.random.normal(0,1,100000), np.random.normal(0,1,100000) ttest_ind(a,b).pvalue As the mean and std are the same and my sample size is pretty…
4
votes
2 answers

T-test for percentage change

Suppose I have some paired data (for example weight before and after), and I wish to find a confidence interval for the percentage increase in weight, can I simply apply the t-test to the percentage difference (A-B)/A or should I use another test?
Kenshin
  • 123
3
votes
2 answers

How to implement formula for a independent groups t-test in C#?

I am writing a program in C# that requires me to use the Ttest formula. I have to effectively interpret the Excel formula: =TTEST(range1,range2,1,3) I am using the formula given here and have interpreted into code as such: double TStatistic =…
3
votes
3 answers

Which test is appropriate for comparing Pre and Post intervention data?

I am conducting research in which employee engagement will be evaluated on approximately 20 participants. They will complete an 11 question Likert-scale survey, have interventions done on them (read a book, read 3 articles, and sit through a…
arma
  • 31
3
votes
1 answer

What statistical test is appropriate when comparing heart rates from different devices?

I am checking the accuracy of one device that finds the heart rate against the other device that gives correct measurements. Specifically, I have performed an experiment on a group of people. I used both device 1 and device 2 simultaneously on the…
3
votes
2 answers

using unpaired t-test when differences not normally distributed

Suppose I have paired data. The differences are however not normally distributed (i.e., we cannot use paired t-test), but the individual data for the two groups are normally distributed and they seem to have equal variances (result from doing a…
Ronald
  • 33
3
votes
1 answer

Applying a t-test to a polling a result

I am trying to analyze a poll result for two different message treatments (T1 and T2) that essentially asks "Was this message helpful?" and there are two responses, "Yes", and "No" (but should be noted that not all survey get a response). We want…
sedavidw
  • 357
1
2 3
11 12