InfluentialPoints.com
Biology, images, analysis, design...
Use/Abuse Principles How To Related
"It has long been an axiom of mine that the little things are infinitely the most important" (Sherlock Holmes)

Search this site

 

 

Just a note

Conversely, you could plot an 'inverse' cumulative distributions by subtracting the relative cumulative value from 100%. Inverse cumulative distributions are useful when we wish to describe what percentage of observations are more than a given value.

The following code produces a cumulative histogram using R.

 

  • wta=c(...) instructs R to put the data into the vector variable wta. h=hist(wta,breaks=seq(380,580,20),plot=FALSE) then instructs R to copy the results of the hist function into a 'data frame' variable called h, but not to plot a histogram.

  • h$counts=cumsum(h$counts) tells R to extract the frequency from the frame variable called h, calculate their cumulative sum, and put the resulting set of values back where they came from.

    To obtain relative frequencies instead, instead of h$counts=cumsum(h$counts) use

  • plot(h,...) asks R to plot the cumulative frequencies against the midpoint of their respective classes, and to label and colour them as directed.