Skip to content
Back to formatted view

Raw Message

Message-ID: <16121.40043.577162.731050@volition.wustl.edu>
Date: 2003-06-25T12:58:19Z
From: Gijsbert Stoet
Subject: cumulative frequency distribution plot

To plot a cumulative distribution of, say a behaviorial reaction time
vector, I wrote the following function:

cumhist = function(x)
{
  Z = hist( x , plot=F )
  plot(1:length(Z$counts),cumsum(Z$counts)/length(x)*100,type="b",axes=F,
       ylab="%",xlab="")
  axis(1,at=1:length(Z$counts),labels=round(1/Z$mids,digits=0))
  axis(2)
}

x must be a vector of the data.