필터 지우기
필터 지우기

How to run a chi-square test?

조회 수: 8 (최근 30일)
Wenlong
Wenlong 2012년 10월 24일
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

답변 (1개)

Ilya
Ilya 2012년 10월 24일
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:
Here is a section showing how to examine the model quality:

카테고리

Help CenterFile Exchange에서 Hypothesis Tests에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by