A
Note on Frequency Distributions:
Obviously a histogram will divide your data into bins. Here I have an imaginary data called “dataname” (actually the kfm$weight from lab)
>hist(dataname,
breaks=10)
>histinfo<-hist(dataname,
breaks=10)
If I type “histinfo” at the prompt, I will see all of the information that this object I created contains:
>histinfo
> histinfo
$breaks
[1] 3.999999 4.200001 4.400001 4.600001 4.800001 5.000001 5.200001
5.400001
[9] 5.600001 5.800001 6.000001 6.200001 6.400001 6.600001
$counts
[1] 1 3 0 6 3 8 8 6 6 3 4 0 2
$intensities
[1] 0.09999934 0.30000000 0.00000000 0.60000000 0.30000000 0.80000000
[7] 0.80000000 0.60000000 0.60000000 0.30000000 0.40000000
0.00000000
[13] 0.20000000
$density
[1] 0.09999934 0.30000000 0.00000000 0.60000000 0.30000000
0.80000000
[7] 0.80000000 0.60000000 0.60000000 0.30000000 0.40000000
0.00000000
[13] 0.20000000
$mids
[1] 4.100000 4.300001 4.500001 4.700001 4.900001 5.100001 5.300001
5.500001
[9] 5.700001 5.900001 6.100001 6.300001 6.500001
$xname
[1] "kfm$weight"
$equidist
[1] TRUE
attr(,"class")
[1] "histogram"
>sum(histinfo$counts*histinfo$mids)/50
I could similarly do this calculation to get a weighted SD and V