Suppose $X_1,…,X_n$ are modeled as normally distributed with mean $μ$, and have T statistic $1.4$.

What is the p-value for testing $H_0:μ=0$ against $H_a:μ<0$?

How can I find the p-value if I am not given degrees of freedom?

  • $\begingroup$ Did the question mention anything about the variance being known/unknown? $\endgroup$
    – B.Liu
    Commented Apr 6, 2021 at 23:55
  • $\begingroup$ @B.Liu unfortunately no, that is the full question $\endgroup$
    – rabito
    Commented Apr 6, 2021 at 23:55
  • 1
    $\begingroup$ That the test statistic is stated to be a t-stat and not a z-stat tells me that the variance is unknown. The best that I can think to do is to give an asymptotic p-value, assuming the sample size goes to infinity and the null distribution converges to standard normal. $\endgroup$
    – Dave
    Commented Apr 6, 2021 at 23:59
  • 1
    $\begingroup$ I might've misunderstand the question, but the degrees of freedom is given in terms of the sample size. Having the T-statistic and the degrees of freedom is sufficient to deduce a p-value. $\endgroup$
    – Firebug
    Commented Apr 7, 2021 at 0:07
  • 1
    $\begingroup$ Of course it is: it's $n$. You can just write the p-value in terms of the t-distribution cdf. My former statistics professors would probably have meant something akin to that in a question written similarly to the one you posted here. $\endgroup$
    – Firebug
    Commented Apr 7, 2021 at 0:12

1 Answer 1


To begin with required structure, suppose I have normal data in vector x with summary statistics as shown:

summary(x);  length(x);  sd(x)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
-2.6342 -1.0172 -0.6990 -0.6650  0.2648  0.4705 
[1] 20           # sample size
[1] 0.9254546    # sample SD

A t test of $H_0: \mu=0$ against $H_a: \mu < 0$ will reject for a sufficiently small (negative) value of the t statistic. Results from t.test in R are as shown below: $T = -3.2135$ is sufficiently small to give P-value $0.002287,$ so we reject $H_0$ at the 5% level.

t.test(x, mu=0, alt="less")

        One Sample t-test

data:  x
t = -3.2135, df = 19, p-value = 0.002287
alternative hypothesis: true mean is less than 0
95 percent confidence interval:
       -Inf -0.3071727
sample estimates:
 mean of x 

The P-value is the probability under $H_0$ (used to compute $T)$ that $T \le -3.2135.$ Typically, one cannot find exact P-values from a printed t table because not enough percentage points are given. But we can use R to show how the exact P-value can be computed. In R, pt is a CDF of the t distribution matching the given DF. Except for minor rounding, the result is as reported in the output of t.test.

pt(-3.2135, 19)
[1] 0.002286805

For a left-tailed test as above, it makes little sense to ask for the P-value matching $T = 1.4$ because we are clearly not going to reject $H_0$ in favor of $H_a$ based on a positive t statistic. The P-value for a test against $H_a: \mu > 0$ based on $T =1.4$ is the probability under $H_0$ that $T \ge 1.4,$ which is #0.0888;$ we could reject at the 10% level, but not at the 5% level.

1 - pt(1.4, 19)
[1] 0.08881538

You are correct that you need to know the degrees of freedom in order to find the P-value. However, for large sample sizes you don't need to know the exact DF in order to get an approximate P-value.

Suppose $n = 50, 100, 200,$ so that degrees of freedom are $\nu = 49, 99, 199.$ If we are testing $H_0: \mu = 0$ against $H_a: \mu < 0,$ and $T = -3.2135,$ then the P-values would all be near $0.003,$ leading to rejection at the 1% level (and below).

dt(-3.2135, 49);  dt(-3.2135, 99);  dt(-3.2135, 199)
[1] 0.003329379
[1] 0.002787947
[1] 0.00253066

Note: The sample x used in the example above was sampled in R with the following code:

x = rnorm(20, -1 , .85)
  • 1
    $\begingroup$ Thanks this is very helpful. It makes sense that to find $\mu > 0$ or $\mu < 0$ to use the pt command; however, if you are trying to find p-value that $\mu \neq 0$ is this just 1 then? $\endgroup$
    – rabito
    Commented Apr 7, 2021 at 16:43
  • 1
    $\begingroup$ For a 2-sided test, find total probability in two tails beyond $\pm T.$ Example: If $T = -3.2135,$ then use code 2*pt(-3.2135, 19). // When using t.test, omit alt parameter because two-sided is the default. Then the P-value in output is suitably doubled. $\endgroup$
    – BruceET
    Commented Apr 7, 2021 at 20:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.