0
$\begingroup$

I want to convert a degree of freedom of t-distribution to follow a standard deviation of normal distribution to plot a density line.

Assume I have a samples (size =14) with mean =0 and sd = 7.8, I want to plot a normal distribution density line with mean =0 and sd = 7.8 and a t-distribution density with same mean =0 and sd =7.8 which will be represented through degree of freedom.

Is it impossible to do it?

Example: Groundwater sulfate concentrations are monitored at a contaminated site over the course of a year.Those concentrations are compared to ones measured at background sites for the same time period. You want to determine if the concentration at the contaminated site is significantly larger than that for the background site. The concentrations of sulfate (in ppm) for both sites are as follows:

contaminated = c(600,590,570,570,565,580)
background = c(560,550,570,550,570,590, 550,580)

H0 : mean of contaminated = mean of background, so, mean of contaminated - mean of background =0, so, expected value of H0 = 0

Ha : mean of contaminated > mean of background, so, mean of contaminated - mean of background >0

se.pooled = sqrt( (length(contaminated)-1)*var(contaminated) + (length(background)-1)*var(background) )/sqrt(length(contaminated)+ length(background)-2)

se.h0 = (se.pooled * sqrt(1/length(contaminated) + 1/length(background))) 
t= (mean(contaminated) - mean(background)) / se.h0
p.value.t = pt(t, df =12 , lower.tail = F) 

With the results of t = 1.809851 and se.h0 = 7.827532, I want to plot a density t-distribution whose mean = expected value of H0 =0 and sd = se.h0 under a normal distribution whose mean = expected value of H0 =0 and sd = se.h0.

I try it but I do not know how to convert the df =12 in t-distribution to be proportional with sd.h0 of normal distribution. Because the t-distribution's variance = n/(n-2), so it only reach to normal distribution curve with sd = 1 (not a sd which I choose) when n get large and the result is:

1st try : I used df = se.h0/ (df of sample)

x.axis = seq(0 - se.h0*3, 0 + se.h0*3, length =100)

plot(x.axis, dnorm(x.axis, mean =0, sd = se.h0), type ="l", col = "red", ylim=c(0,0.27))
lines(x.axis, dt(x.axis-0, df = se.h0/12), type = "l")
abline(h=0)
abline(v= t*se.h0, col = "red", lty =2)
abline(v= 0, lty =2)

the plot looks quite good but I know something wrong in that because t-distribution has a variance = df/(df-2), so the t distribution density curve is too thin and fall out side the normal distribution density curve

https://app.box.com/s/uzyjr17go6fybgqzz94j4td0fxw4f7er

Red line is normal distribution and blue line is t distribution density Red dash-line is x= t ( t statistic I computed above)

2nd try: I used df = 2*var/ (var -1) = 2*se.h0^2 / (se.h0^2 -1) and the plot look disaster ! Red dash-line x= t fall outside the density curve of t-distribution

https://app.box.com/s/svt2x66jmsj8lzqcllcutlliufn20g08

EDIT : I found the solution

plot(x.axis, dnorm(x.axis, mean =0, sd = se.h0), type ="l", col = "red")
lines(x.axis, dt.scaled(x.axis, df=12, mean =0, sd = se.h0), type ="l", col = "blue")
abline(h=0)
abline( v= t*se.h0, col = "red", lty =2)
abline( v= 0, lty =2)
$\endgroup$
1
  • $\begingroup$ Thw standard deviation of a (location-scale family) t-distribution is $\sigma\sqrt{\frac{\nu}{\nu-2}}$ $\endgroup$
    – Glen_b
    Commented Aug 4, 2017 at 3:08

1 Answer 1

1
$\begingroup$

The $\nu$ parameter (degrees of freedom) parameter of $t$ distribution controls the tails of the distribution. On another hand, the $\sigma$ parameter of normal distribution controls the scale or spread of the values. Those parameters control different things, so it can't be done.

Why do you want to do this? If you need a $t$ distribution parametrized by standard deviation, then why not use location-scale version of it? If $f$ is a probability density function of standard $t$ distribution, then location-scale variant would be: $ \sigma^{-1} f\left(\tfrac{x-\mu}{\sigma}\right) $, with $\nu=\infty$ this would converge to normal distribution parametrized by $\mu,\sigma$.

$\endgroup$
2
  • $\begingroup$ Tim, Thanks you so much. I follow your guidance and finally solve the problem. It is very basic with dt.scaled function in R for doing location-scale version. I appreciate it alot. Have a nice day, Tim. $\endgroup$
    – Iamsomean
    Commented Aug 3, 2017 at 23:16
  • $\begingroup$ @lamsomean you can find an implementation also in (mine) extraDistr package under the name (d/p/q/r)nst. $\endgroup$
    – Tim
    Commented Aug 4, 2017 at 6:22

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.