Frequency Curve

Author

Eric W. Weisstein
February 22, 2011

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Statistics/FrequencyCurve.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/FrequencyCurve.html.

©2011 Wolfram Research, Inc. except for portions noted otherwise

Figure

DataTable[data_List,bins_List]:=Module[{i,f=BinCounts[data,bins],fsum},
fsum=Tr[f];
Table[
{ToString[bins[[1]]+bins[[3]](i-1)]<>"-"<>ToString[bins[[1]]+bins[[3]]i-.01],bins[[1]]+(i-.5)bins[[3]],f[[i]],f[[i]]/fsum,Tr[Take[f,i]],Tr[Take[f,i]]/Length[data]},
{i,(bins[[2]]-bins[[1]])/bins[[3]]}]//N
]

DataTable[data,{0,100,10}]//TableForm

data100=Table[Random[NormalDistribution[50,15]],{100}];
bins100=BinCounts[data100,{0,100,10}];

barLabels[x0_,x1_,{dx_,ddx_}]:=Module[{i},
Flatten[Table[{ToString[i],Table["",{dx/ddx-1}]},{i,x0,x1,dx}]]
]

data1000=Table[Random[NormalDistribution[50,15]],{10000}];
bins1000=BinCounts[data1000,{0,100,1}];

V5

Show[GraphicsArray[{
BarChart[bins,PlotRange->All,BarLabels->barLabels[0,95,{20,50}],BarGroupSpacing->0],
BarChart[bins1000,PlotRange->All,BarLabels->barLabels[0,95,{20,1}],BarGroupSpacing->0],
Plot[Exp[-(x-50)^2/(2 15^2)]/Sqrt[2Pi],{x,0,97},Ticks->{Automatic,None}]
}]]

V6

GraphicsRow[{
BarChart[bins100,PerformanceGoal->"Speed"],
BarChart[bins1000,PerformanceGoal->"Speed"],
Plot[Exp[-(x-50)^2/(2 15^2)]/Sqrt[2Pi],{x,0,97},Ticks->{Automatic,None}]
}]