# Would a paired t-test be appropriate if the variables had a range between 0 and 1?

Suppose I have paired data $$(X_1, \ldots, X_n)$$ and $$(Y_1, \ldots, Y_n)$$ and I would like to compare if the means $$\bar{X} = \frac{1}{n}\sum_{i=1}^nX_i$$ and $$\bar{Y} = \frac{1}{n}\sum_{i=1}^nY_i$$ are significantly different.

The range of each variable is between 0 and 1: $$X_i \in (0,1)$$ and $$Y_i \in (0,1)$$.

In this case, would a paired t-test be appropriate due to the fact they range from 0 to 1?

• Your $\bar X$ and $\bar Y$ are sums not means. Commented Apr 13, 2022 at 6:40
• The t-test results never change when you rescale all values. Thus, if we wanted, we could always normalize variables in any t test to place them in the interval $(0,1).$ In this sense your question is devoid of content: the ranges of the variables are irrelevant.
– whuber
Commented Apr 13, 2022 at 15:33

Possibly appropriate, but not necessarily. There's two things to worry about: significance level, and power.

1. If the distribution is sufficiently skew (for example), the actual significance level might not be reasonably close to the desired one at some given sample size.

2. The power properties of a t-test might be relatively poor compared to one based on a more suitable choice of distributional model.

Yes, provided that $$n$$ is sufficiently large for the approximate (asymptotic) normality of $$\bar{X}$$ and $$\bar{Y}$$ to hold.

It's difficult to say exactly what value of $$n$$ is appropriate here, but if you make, say, a confidence interval (say, 95% or 99%) for the two population means, using the standard set up:

$$\bar{u} \pm t \sqrt{ \frac{s_u^2}{n} }$$

where $$\bar{u}$$ is the mean of the sample, $$s_u^2$$ is the sample standard deviation, $$n$$ is the sample size and $$t$$ is your relevant critical value, and neither interval spills outside of $$(0,1)$$, I'd imagine you would be fine

As @jcken points out, if your $$n$$ is sufficiently large, you can utilize a t-test, but if your means are in fact proportions--and I'm guessing that they are as they're bounded between 0 and 1--and you have the counts the proportions are based on, then you're probably better off utilizing a Chi-squared test of independence (or possibly Fisher's exact test).

Scaling (except by zero; negative scale will be equivariant in sign and invariant in magnitude) and translating both $$X_i$$ and $$Y_i$$ by the same amount will leave the t-statistic unchanged. Something I do not like is the boundedness of these variables being used in a t-test where the probability model might be assumed to be t-distributed. Because the t distribution supports the real number line, it would seem like in principle you have the wrong probability model.

As @jcken notes, normality will approximately hold for large sample sizes and that a confidence interval based on the t-distribution might be contained in the interval $$(0,1)$$. But then again, such a confidence interval still assumes that the total probability mass is spread out over $$\mathbb{R}$$ (i.e. unbounded) rather than $$(0,1)$$ so such an estimated interval doesn't have the desired meaning. Perhaps an error bound could be put on it if the correct model is known, but then it isn't clear why one wouldn't just use the correct model if its corresponding interval could be calculated.

My suggestion is you either find a bounded distribution that resembles your data, e.g. possibly the Beta distribution, or that you use bootstrapping if the sample size is adequate.

• The t-test does not assume a t distribution for the data. Indeed, when the distributions are bounded, especially when they are close to uniform, a t-test often works extremely well and bootstrapping can be an inferior approach.
– whuber
Commented Apr 15, 2022 at 15:27
• @whuber The distribution of the t-test score will depend on in the distributions of the variables they are calculated from, and under some assumptions CLT or other results may nicely apply. I have seen first hand that people default to assuming the t-test score is t-distributed, and often enough so that it is my default concern that a t-distribution will be assumed. My worry is well-founded empirically. Commented Apr 15, 2022 at 15:40
• @whuber I don't know what you mean by "extremely well" and "inferior approach". Are you referring to rates of convergence? Variance of the estimator? Commented Apr 15, 2022 at 15:40
• Accuracy of the Student t distribution for computing p-values. Check it out: see how the t-test works when the underlying distribution is uniform, for instance.
– whuber
Commented Apr 15, 2022 at 15:49

The question asks about paired t tests, but with no hint about the nature of the paring or about correlation between $$X_i$$ and $$Y_i.$$ Thus, it might make more sense as a question about t tests for two independent samples, which I address here.

@Glen_b (+1) mentions concerns with power and significance level, which would also make sense in the 2-sample case. Here are a few related simulations.

With two independent samples of size 25, the Welch t test has very good power distinguishing between beta distributions with means $$1/3$$ and $$2/3.$$

set.seed(2022)
pv = replicate(10^5, t.test(rbeta(25,1,2),
rbeta(25,2,1))$p.val) mean(pv <= .05) [1] 0.99694 # aprx power  Also, between beta populations with means $$2/5$$ and $$3/5.$$ set.seed(2022) pv = replicate(10^5, t.test(rbeta(25,2,3), rbeta(25,3,2))$p.val)
mean(pv <= .05)
[1] 0.92727  # aprx power


Some beta distributions with larger shape parameters are more nearly normal.

Also, the significance level for two populations, both distributed $$\mathsf{Beta}(2,2),$$ is about 5% as expected.

set.seed(2022)
pv = replicate(10^5, t.test(rbeta(25,2,2),
rbeta(25,2,2))$p.val) mean(pv <= .05) [1] 0.05098 # aprx signif level  Equal means, unequal variances: set.seed(2022) pv = replicate(10^5, t.test(rbeta(25,.5,.5), rbeta(25,2,2))$p.val)
mean(pv <= .05)
[1] 0.05042


With two independent samples of size 25, the Welch t test has power about 85% distinguishing between skewed beta distributions with means $$1/200$$ and $$1/500,$$ as shown in the R code below.

pv = replicate(10^5,
t.test(rbeta(25,1,199),
rbeta(25,1,499))$p.val) mean(pv <= .05) [1] 0.85137  When the null hypothesis is true with means $$1/500,$$ the significance level is about 4.7%. [For samples of size 50 (not shown) the significance level is about 4.8%.] set.seed(2022) pv = replicate(10^5, t.test(rbeta(25,1,499), rbeta(25,1,499))$p.val)
mean(pv <= .05)
[1] 0.04678


For means $$1/500$$ and $$499/500.$$ the power is near $$1.$$

set.seed(2022)
pv = replicate(10^5,
t.test(rbeta(25,1,499),
rbeta(25,499,1))\$p.val)
mean(pv <= .05)
[1] 1


Overall, the Welch t test does not work quite as well for such severely skewed distributions as for the beta distributions in the main part of this Answer, and its usefulness degrades further for some even more extreme examples.

• Simulations are definitely worth doing (+1), but you have only considered pretty mild cases; at those sample sizes on a two-sample t-test you won't see the trouble you can get into when things are not so nice. Now, a beta (0.5,200), for example, would be a somewhat different story (and much more so for a one-sample test). Yet sometimes very skewed distributions of proportions are possible (e.g. think about weak concentrations of one substance in another across a variety of test sites) Commented Apr 15, 2022 at 6:26
• ... where the concentrations might span orders of magnitude Commented Apr 15, 2022 at 6:32
• @Glen_b. Thanks much for comment. Certainly, you are right that two-sample tests work more predictably than one-sample tests. Because I'm already a bit off-topic with two-sample tests, I didn't show everything I tried, but (maybe because I'm not easily surprised) I found nothing I thought was astonishing. In a few hours, wider awake, I'll try to make a coherent addendum with some highly skewed beta distributions. Commented Apr 15, 2022 at 8:25