Info
This question is closed. Reopen it to edit or answer.
Why is my chi-squared distribution such a rubbish representation?Have I done something wrong?
2 views (last 30 days)
Show older comments
I have data from 1994-2014 for births by mothers ages. I want to test the distribution for the Under20's mother ages. I have plotted a histogram with the information and tried to test the chi2pdf.
figure
x2=[];
[n,x2] = hist(x2,28); %Compute histogram
hbar2 = bar(x2, n/trapz(x2,n)); %Bar plot of histogram
hold on
%chi-distriution theoretical overlay
Ychi2 = chi2pdf(80000:1:150000,20);
hchi2 = line(80000:1:150000,Ychi2,'Color','b','LineWidth', 2);
0 Comments
Answers (1)
Star Strider
on 18 Dec 2016
‘I want to test the distribution for the Under 20's mother ages.’
Test them for what?
Plot this first:
t = 1994:0.5:2004;
x2=[108111,112615,119719,132456,134946,137312,136012,135971,130784,127828,122145,121072,116622,110959,108844,107741,110722,113537,118589,125732,130744];
figure(1)
plot(t, x2)
grid
Then figure out what you want to do with your data.
1 Comment
Star Strider
on 18 Dec 2016
The Fourier transform will give you the frequency content of your data. That may be irrelevant information in your situation.
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!