LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with statistical functions

Hi masters or Scientists:
I have a problem using a vi called "T distribution":
(Or Inv T Distribution)
This function is located into:
Functions >> Probability and Statistics >> Probability
I have noticed a big difference between this function results and the same
values appearing in Statistical t-Student tables or for example if you make
this calculation using MS Excel.

Example:Using Labview
degrees of freedom=10; Probability=0,99
x=2.7637
Using Excel:
degrees of freedom=10; Probability=1-0,99=0,01 (Excel uses this)
x=3,1693

As you can see, is a large difference.
If you hesitate you can use a Math SW or take a look at Statistical Book for
t-student tables.

Any explanation?
Thanks in advance
--
Francisco Javier Ferna
ndez Luna
Ingeniero Tec. Industrial en Electronica.
Tel: 619 81 98 31
franciscojavier.luna@uca.es
ó pacoluna@postmark.net
Would you like your answer in spanish? Please, let me know.
Si prefiere que conteste a sus preguntas en español, por favor, hagamelo
saber.

"Let's make things better" (PHILIPS)
Message 1 of 2
(3,700 Views)
Labview vs. Excel T-distribution functions compared:

First of all, the T-distribution density function looks much like a normal distribution, broader for low degrees of freedom and quickly converging to the normal curve for high degrees of freedom.
The t-distribution probability is the area under the curve to one side of a point on the x-axis.

I believe in order to avoid confusion, in Labview, the t-distribution vi-s always give the value for the "one-tailed" distribution, i.e. the probability is always the area to the left of the specified point. So using the numbers above:
with x=2.7637 and degrees of freedom = 10,
the resulting Probability =0.99 means that's the area under the curve "FROM NEGATIVE INFINITY to 2.7637".

Similarly,
with x= -2.7637 and degrees of freedom = 10,
the resulting Probability =0.01 means that's the area under the curve "FROM NEGATIVE INFINITY to -2.7637".

Therefore with the Inverse T-distribution, and
degrees of freedom=10; Probability=0.01, the question is:
"What is the X such that the area under the curve "FROM NEGATIVE INFINITY to this number (X)" equals the needed probability (0.01)?
The result is X= -2.7637.

Since the distribution is symmetrical, we can see why a probability of 0.99 would give X=2.7637. (there is 0.01 probability under the curve to the right of X = 2.7637.)

But if we stay within single-tail probabilities of <50%, we can define a "two-tailed" t-distribution:
The probability for a given point X is the area under the curve "FROM NEGATIVE INFINITY to -X" + "From X to POSITIVE INFINITY" = twice the single-tailed value.
That is: The probability is equal to "THE AREA IN THE TAILS (outside the interval -X to X".

And if we need to find the inverse in Labview, which only uses the one-tailed distribution, we can find the probability in the tails, divide by two (two tails), and feed it into the Inverse T-Distribution.

With the above numbers, if the probability of a number being between -X and X is 0.99, then the probability of it being outside it (in the tails) is 0.01. Dividing by two (for the two-tailed distribution) gives
degrees of freedom=10; Probability=0.005 and the result is:
X= -3.1693. You can see that the same probability is that the number is in the right tail, to the right of +3.1693.

Now, in Excel, the distribution function lets you specify a one-tailed or two-tailed distribution, although curiously, even for the one-tailed one, the X takes on only positive values. (Effectively the probability is defined as "the area under the curve to the right of the given number"
=TDIST(2.7637,10,1) gives 0.01 (in the tail to the right of X = 2.7637), and
=TDIST(2.7637,10,2) gives 0.02, as expected.
=TDIST(-2.7637,10,1) gives an error.

But in Excel the inverse function always assumes a "two-tailed" t-distribution, so the Excel formula:
=TINV(0.01,10) gives the value 3.1693,
which means, with ten degrees of freedom, "The probability (area under the curve) outside the interval -3.1693 to 3.1693 is 0.01."

Therefore, if one wanted to find the inverse of the one-tailed t-distribution in Excel, one would have to multiply the one-tailed probability by two.
With the above numbers, if the probability of a number being to the left of -X (or to the right of +X) is 0.01, then to find X, that's the same as finding the a number X, such that the two-tailed probability is 0.02.
=TINV(0.02,10) gives 2.7637,
meaning the sum of the areas under the curve to the left of -2.7637 and to the right of 2.7637 is 0.02. So just one of them is 0.01, which is what we wanted.

I guess some examples as these (and possibly graphical illustrations) would be quite helpful :), in both Labview and Excel help files. But until then, make do with this.

Cheers.

Stoyan Smoukov, Ph.D.
Message 2 of 2
(3,700 Views)