On Wed, Aug 3, 2011 at 5:11 AM, r student <student...@gmail.com> wrote: > Like below? > > plot(density(oh$FINCP,weights=oh$PWGTP/sum(oh$PWGTP))) >
Yes If you are doing lots of analyses with weighted data you might want to look at the survey package. It also has a density estimator, in svysmooth(), which works very much the same way as density() for weighted data, but doesn't complain about rescaling the weights. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.