Ohh, and two last things, those values for mu and sd are my values for my mean and standard deviation. Also, my original data is in the form of a histogram made up of 13 columns (bins). Not sure if that means anything. Thanks in advance
Creating a normal distribution and chi^2 test
5 次查看(过去 30 天)
显示 更早的评论
I have a single set of data with 369 values. I want to be able to analyze this, but since there was only one set, I don't believe I can performa any statistical test on the set that would benefit me. So I want to creat a normal distribution using the already known standard deviation and mean. Then I want to perform a chi-squared test on this sample against the data I already have.
I know of the hist command, but dont really think I can use that with just the mean and standard deviation. I found this somewhere but not really sure if this is correct or anything. Any help?
mu = 0.118733568;
sd = 0.141034278;
ix = -3*sd:1e-3:3*sd; %covers more than 99% of the curve
iy = pdf('normal', ix, mu, sd);
plot(ix,iy);
采纳的回答
Wayne King
2013-3-5
编辑:Wayne King
2013-3-5
Why do you think you cannot perform any statistical test that will benefit you when you have 369 measurements?
In many contexts, a single data set consisting of 369 measurements is a lot of data.
What hypothesis about your data are you interested in testing.
You mention the chi-square goodness of fit test, if you have the Statistics Toolbox, you can test the assumption that you are data follow a normal distribution with the sample mean and standard deviation
For example:
x = 10+0.5*randn(369,1);
[h,p] = chi2gof(x,'cdf',{@normcdf,mean(x),std(x)});
The above is assuming that x is your data (369 values). You'll see above that h is equal to 0 which means you cannot reject the null hypothesis that the data follow a normal distribution with mean(x) and std(x)
Now consider:
x = 10+0.5*rand(369,1);
[h,p] = chi2gof(x,'cdf',{@normcdf,mean(x),std(x)});
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!