How to run a chi-square test?
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi all,
I am trying to run a chi-square test on my data.
I have a vector of eigenvalues from PCA and they are ordering in descending order. I want to test the linear trend in the eigenvalue vector. However, the Matlab help says that the chi2gof just test the data is from the normal distribution.
So, my question is, is there any way to adapt chi2gof function in my test of linear trend? Or I should look for other functions?
Thank you very much.
Best wishes
Wenlong
0 commentaires
Réponses (1)
Ilya
le 24 Oct 2012
chi2gof tells you how closely the observed distribution resembles your theoretical guess. You don't have a distribution yet. To test for a linear trend, you can fit your data to a straight line by least squares.
Start by inspecting the fit visually. A formal test is often not necessary. If you need a formal test, you can assume, as is often done, that the residuals are normally distributed.
Here is doc on linear models:
http://www.mathworks.com/help/stats/parametric-regression-basics.html http://www.mathworks.com/help/stats/linear-regression-1.html
Here is a section showing how to examine the model quality:
0 commentaires
Voir également
Catégories
En savoir plus sur Hypothesis Tests dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!