Re: [R] density plot for weighted data

2011-08-02 Thread Thomas Lumley
On Wed, Aug 3, 2011 at 5:11 AM, r student 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 mu

Re: [R] density plot for weighted data

2011-08-02 Thread r student
Like below? plot(density(oh$FINCP,weights=oh$PWGTP/sum(oh$PWGTP))) On Tue, Aug 2, 2011 at 10:06 AM, David Winsemius wrote: > > On Aug 2, 2011, at 12:51 PM, r student wrote: > >> I'm trying to create a density plot using census data, where the >> weights don't sum to 1. >> >> >>> plot(density

Re: [R] density plot for weighted data

2011-08-02 Thread David Winsemius
On Aug 2, 2011, at 1:11 PM, r student wrote: Like below? plot(density(oh$FINCP,weights=oh$PWGTP/sum(oh$PWGTP))) I don't understand why you are asking for approval. You are the one with the data and know where they came from. We have none of that background. -- David. On Tue, Aug 2, 20

Re: [R] density plot for weighted data

2011-08-02 Thread David Winsemius
On Aug 2, 2011, at 12:51 PM, r student wrote: I'm trying to create a density plot using census data, where the weights don't sum to 1. plot(density(oh$FINCP,weights=oh$PWGTP)) Warning message: In density.default(oh$FINCP, weights = oh$PWGTP) : sum(weights) != 1 -- will not get true dens

[R] density plot for weighted data

2011-08-02 Thread r student
I'm trying to create a density plot using census data, where the weights don't sum to 1. >plot(density(oh$FINCP,weights=oh$PWGTP)) Warning message: In density.default(oh$FINCP, weights = oh$PWGTP) : sum(weights) != 1 -- will not get true density How would I go about doing this? Thanks!