critical value of a statistic test

I need to calculate the critical value of a test statistics for a given data, in order to detect gross errors in a thermodynamic system.
Does anybody know how to do this? Is there any tool to calculate this value?
Thank you!

2 Comments

Depends. What do you want to test? More details are needed to keep us from guessing.
Josep
Josep on 9 Sep 2014
Edited: Josep on 9 Sep 2014
Okay! I have a thermodynamic system with 53 measured variables and I am doing a gross error detection. For this, I have to compute an equation (a test statistics), for the combination of all the variables. If the value of the test is higher than the critical value, than it means that in this combination it would probably be an error. I have computed the test statistics for all the combinations for one variable, but now I need the critical value to compare and analyse the results. Here I attach you my code if you want.
Thank you!

Sign in to comment.

 Accepted Answer

Star Strider
Star Strider on 8 Sep 2014
That depends on how the test statistics are distributed. If you know that, then you use the appropriate probability distribution and the value of the test statistic to get the probability. The critical value of the probability is generally considered to be p = 0.05.

19 Comments

p = 0.05 is the p-value, isn't it? Okay, I attached above the code and the excel file I am using. I achieve 53 values of the test statistics computing the equation, so by computing this and by considering p = 0.05, do you know how to calculate this critical value?
Thank you Star Strider!
Star Strider
Star Strider on 9 Sep 2014
Edited: Star Strider on 9 Sep 2014
My pleasure!
I need to know what the test statistic is, and how it is distributed. With those, I can help you calculate the probability or the value of the test statistic that is equal to p=0.05.
The code is above, but I attach you here anyway. Is this enough for you to calculate the critical value of the test?
It isn’t. I know nothing about the statistic itself or how it is distributed. I need that to calculate probabilities or critical values for the statistic on it.
the only thing you need to know is how it is distributed? Do you know how can I know how is my system distributed? I have no idea on statistics
Yes. The distribution of a statistic is essentially all that is necessary to determine if any statistic meets a critical value. You should be able to determine the distribution for your statistics from the literature you used to calculate them. You will also have to find out if the distribution is dependent on the number of observations and other constraints (degrees-of-freedom) and how they affect the calculation.
What I am doing is a gross error detection. For this, I am using the GLR test. I acchieve a value of a test statistics by computing this equation: T = inv(Fk'*inv(V)Fk)*(Fk'*inv(V)*r)^2
Where Fk is are the columns of the variables suspected to contain errors, V is the covariance matrix and r the residuals matrix.
By computing this equation, I achieve a value, (the test statistics for each variable), and the code is already done, but now, to analyse the results, I need to calculate the critical value of the test statistics. If the test exceeds the critical value, then it will mean that it is suposed to be an error in the variable, so to take this conclusions, I need to calculate the critical value and I don't know how.
okay! I will read about it to know how to find the distribution and the degrees of freedom
How is the T-statistic in the GLR test distributed? Does it use the normal distribution, the Student t-distribution, F-distribution, chi-squared distribution, or something else?
chi squared distribution
I believe we’ve established that you don’t have the Statistics Toolbox. If you did, you would simply need to use the chi2cdf or chi2inv function, depending on whether you want to calculate the probability or the critical value.
Are all the degrees-of-freedom in all your statistics the same? You need to know the degrees-of-freedom for each statistic, otherwise.
There is a chi-squared distribution calculator at the TAMU chisqdemo page that is probably more convenient for you.
If all else fails, I can calculate the critical values for the chi-squared statistic and just post it here. I will need to know the statistics and the degrees-of-freedom for each, if the degrees-of-freedom differ between them. I will defer to you to calculate the degrees-of-freedom in any event.
You would also need to know if you need a two-tail or one-tail test (left or right).
True. The interpretation being ‘different from’ (two-tailed) or ‘greater than’ (left one-tailed) or ‘less than’ (right one-tailed).
Okay I have seen there is a tool to calculate the critical value of the test, knowing the degrees of freedom and the distribution (chi-squared in my case)
critical=chi2inv(1-alpha,df) % to calculate the critical value of the test
Am I right?
You are. That is the correct function to calculate the critical value for your statistic. (I didn’t realise you have the Statistics Toolbox. That was the issue with your not being able to use combnk earlier.)
Perfect, I didn't realise also because I am working in a computer that is not mine. Thank you one more time!
My pleasure!
I have achieved all the results of the test to de detect gross errors in the system, only for the combination of one variable. I attach here the results, is it possible to achieve the same values of the test for different variables? the critical value is 25, so here I can see we have lots of errors in the variables, do you think I can trust the test?
I have also estimated the magnitude of the gross errors, if the result is negative, it means that I don't have a gross error in the variable?
I can only speak to the chi-squared results. If the critical value for the chi-square statistic is 25 (assuming alpha = 0.05), those values greater than 25 simply mean that their probabilities of being accounted for by chance are individually <0.05. They are significantly different from the expected value at alpha = 0.05. But that’s all you can say about them.
I don’t know how to interpret the rest of your data. I have no idea what the ‘gross errors’ mean, or how to interpret them. Sorry.

Sign in to comment.

More Answers (0)

Asked:

on 8 Sep 2014

Commented:

on 10 Sep 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!