An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120205/ece721d0/attachment.pl>
histogram
6 messages · Francis Keyes, David Winsemius
On Feb 5, 2012, at 8:31 PM, Francis Keyes wrote:
With R and the hist function, is there a way to make a histogram in which the y axis denotes propotion with respect to a separate sample dataset of the same range instead of frequency?
hist() returns an object with both "counts" and "density". If you had a reference population it should be a fairly simple matter to use one or the other of those.
David Winsemius, MD West Hartford, CT
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120206/00ab1efb/attachment.pl>
On Feb 6, 2012, at 12:23 PM, Francis Keyes wrote:
Thanks. How do you suggest I use the reference population? Sorry, I'm new to R and just don't see it. If i can get a plot that is counts or density relative to my reference data it would be ideal.
It is difficult to specify "how" when we have no "what". The "what" is your responsibility, not ours. My thought was to use the ratio of the results of hist() on the two populations which would then be offered back to hist or barplot. ....which (of course) requires that the 'breaks' be the same. Provide an example of your R representations of the reference population and tested population and all will become clear. (And learn to post in plain text, please.)
David Winsemius, MD West Hartford, CT > > On Mon, Feb 6, 2012 at 1:12 AM, David Winsemius <dwinsemius at comcast.net > > wrote: > > On Feb 5, 2012, at 8:31 PM, Francis Keyes wrote: > > With R and the hist function, is there a way to make a histogram in > which > the y axis denotes propotion with respect to a separate sample > dataset of > the same range instead of frequency? > > hist() returns an object with both "counts" and "density". If you > had a reference population it should be a fairly simple matter to > use one or the other of those. >
Hi David, I have 2 tables, each with several columns and rows of data. I am only interested in the data from column 6, which contains values in the range -PI to PI. I want to plot the data from tableD with the y axis denoting percentage with respect to tableR. So if data points in the break 2 - 3 appear half as often in tableD as in tableR, the y axis should show 50 percent. Does that make sense? I've been plotting the data like this to date: hist(tableD[,6],ylab="frequency", xlab="angle") Thanks a lot for your help
On Mon, Feb 6, 2012 at 1:31 PM, David Winsemius <dwinsemius at comcast.net> wrote:
On Feb 6, 2012, at 12:23 PM, Francis Keyes wrote:
Thanks. ?How do you suggest I use the reference population? ?Sorry, I'm new to R and just don't see it. ?If i can get a plot that is counts or density relative to my reference data it would be ideal.
It is difficult to specify "how" when we have no "what". The "what" is your responsibility, not ours. My thought was to use the ratio of the results of hist() on the two populations ?which would then be offered back to hist or barplot. ....which (of course) requires that the 'breaks' ?be the same. Provide an example of your R representations of the reference population and tested population and all will become clear. (And learn to post in plain text, please.) -- David Winsemius, MD West Hartford, CT
On Mon, Feb 6, 2012 at 1:12 AM, David Winsemius <dwinsemius at comcast.net> wrote: On Feb 5, 2012, at 8:31 PM, Francis Keyes wrote: With R and the hist function, is there a way to make a histogram in which the y axis denotes propotion with respect to a separate sample dataset of the same range instead of frequency? hist() returns an object with both "counts" and "density". If you had a reference population it should be a fairly simple matter to use one or the other of those.
On Feb 6, 2012, at 5:26 PM, Francis Keyes wrote:
Hi David, I have 2 tables, each with several columns and rows of data. I am only interested in the data from column 6, which contains values in the range -PI to PI. I want to plot the data from tableD with the y axis denoting percentage with respect to tableR. So if data points in the break 2 - 3 appear half as often in tableD as in tableR, the y axis should show 50 percent. Does that make sense? I've been plotting the data like this to date: hist(tableD[,6],ylab="frequency", xlab="angle")
It all makes sense, (and it made sense before) , but your responsibility is to provide data. (Contrats on plain text lesson successfully met.)
Thanks a lot for your help On Mon, Feb 6, 2012 at 1:31 PM, David Winsemius <dwinsemius at comcast.net
wrote: On Feb 6, 2012, at 12:23 PM, Francis Keyes wrote:
Thanks. How do you suggest I use the reference population? Sorry, I'm new to R and just don't see it. If i can get a plot that is counts or density relative to my reference data it would be ideal.
It is difficult to specify "how" when we have no "what". The "what" is your responsibility, not ours. My thought was to use the ratio of the results of hist() on the two populations which would then be offered back to hist or barplot. ....which (of course) requires that the 'breaks' be the same. Provide an example of your R representations of the reference population and tested population and all will become clear. (And learn to post in plain text, please.) -- David Winsemius, MD West Hartford, CT
On Mon, Feb 6, 2012 at 1:12 AM, David Winsemius <dwinsemius at comcast.net
wrote:
On Feb 5, 2012, at 8:31 PM, Francis Keyes wrote: With R and the hist function, is there a way to make a histogram in which the y axis denotes propotion with respect to a separate sample dataset of the same range instead of frequency? hist() returns an object with both "counts" and "density". If you had a reference population it should be a fairly simple matter to use one or the other of those.
David Winsemius, MD West Hartford, CT