# How to Work Student t-Distribution

I'm working with the sampling distribution of the sample mean and sample variance. For my data, I have the following sample mean = 0.418, standard deviation = 0.306, and degrees of freedom = 44. I've determined the 95% confidence interval (CI) is [0.3266,0.5099]

Below is the plot the Student t-distribution for these parameters. My questions are as follows:

1. How can I color the area under this distribution to show the 95% CI?
2. How can I use NIntegrate to verify the area between the 95% CI is 0.95?
Plot[PDF[StudentTDistribution[0.418, 0.306, 44], x], {x, -1, 2},
PlotRange -> All, Filling -> Axis]

• To find confidence intevals, look at 36827.
– Syed
Nov 19, 2022 at 4:34

Try

pl1 = Plot[
PDF[StudentTDistribution[mean = 0.418, stDev = 0.306, degFr = 44],
x], {x, -1, 2}, PlotRange -> All];
pl2 = Plot[
PDF[StudentTDistribution[mean, stDev, degFr], x], {x, 0.3266,
0.5099}, PlotRange -> All, Filling -> Axis,
AxesOrigin -> {0, 0}];
Show[{pl1, pl2}]


But your confidence interval does not seem right, because the above gives:

• ya; I will have to look into that ... thank u Nicholas! Nov 18, 2022 at 23:42
• @PRG And the corresponding NIntegrate is NIntegrate[ PDF[StudentTDistribution[mean, stDev, degFr], x], {x, 0.3266, 0.5099}]. It is considered good form to accept and like answers. Nov 18, 2022 at 23:55
• yes, Nicholas ... I hadn't finished the correspondence. Nov 19, 2022 at 0:33