Hi Rick,
I came across your posting that I had replied to. I had assumed from
your posting that you had positive integer weights, and that you had a
certain kind of stratified sampling. For a general case, you may want to
look at survey package. Graphical representation of survey data,
Thomas Lumley tlumley at u.washington.edu writes:
On Wed, 30 Aug 2006, Rick Bischoff wrote:
Unfortunately, it seems that most(all?) of R's graphics and summary
statistic functions don't take a weight or frequency argument.
(Fortunately the models do...)
I have been been meaning to
One solution is to simulate the population by repeating each row
weight number of times. This is inefficient. It may create a very
large dataset for a large sample survey. But some of graphs and other
things may turn out to your liking, depending upon how the functions are
written.
Anupam.
Rick
The data sets I am working with all have a weight variable--e.g.,
each row doesn't mean 1 observation.
With that in mind, nearly all of the graphs and summary statistics
are incorrect for my data, because they don't take into account the
weight.
For example median is incorrect, as the
In each case, look around (help.search,
RSiteSearch) to see if you can find a function
that handles weights. For the case you mention,
medians, it can be done via quantile regression:
x - w - 1:5
library(quantreg)
coef(rq(x ~ 1, weight = w))
On 8/30/06, Rick Bischoff
Unfortunately, it seems that most(all?) of R's graphics and summary
statistic functions don't take a weight or frequency argument.
(Fortunately the models do...)
I have been been meaning to add this functionality to my graphics
package ggplot (http://had.co.nz/ggplot), but unfortunately
On Wed, 30 Aug 2006, Rick Bischoff wrote:
Unfortunately, it seems that most(all?) of R's graphics and summary
statistic functions don't take a weight or frequency argument.
(Fortunately the models do...)
I have been been meaning to add this functionality to my graphics
package ggplot
@stat.math.ethz.ch
Subject: [R] working with summarized data
The data sets I am working with all have a weight variable--e.g., each
row doesn't mean 1 observation.
With that in mind, nearly all of the graphs and summary statistics are
incorrect for my data, because they don't take into account the weight