Skip to content

Case weighting

6 messages · Hed Bar-Nissan, David Winsemius, Daniel Nordlund +1 more

#
On Feb 23, 2012, at 10:49 AM, Hed Bar-Nissan wrote:

            
You want "case repetition" not case weighting, which I would use as a  
term when working on estimation problems:

 >  ( data.weighted <- unlist(sapply(1:NROW(data.recieved),  
function(x) rep(data.recieved[x,1], times=data.recieved[x,2] ))  ) )
  [1] No  No  No  No  No  No  No  No  No  No  Yes Yes Yes
Levels: Yes No
Seems to work with the factor vector, although I didn't replicate  
dataframe rows, but I guess you could.
David Winsemius, MD
West Hartford, CT
#
On Feb 23, 2012, at 3:27 PM, Hed Bar-Nissan wrote:

            
You should always convey the necessary complexity of the problem.
The survey package by Thomas Lumley provides for a wide variety of  
weighted analyses.
#
Are these survey sampling weights?  If so, then you need to be using procedures that take the sampling design into account.  Otherwise, your variance estimates are going to be all wrong.

Dan

Daniel Nordlund
Bothell, WA USA
#
Yes.  It doesn't do everything that SPSS WEIGHTED BY will do, but it
does a lot.  SPSS is more general partly because it cheats -- it
doesn't always compute the right standard errors if the weights are
sampling weights   [SPSS now has some proper survey analysis commands,
which do get the right standard errors, but are more limited]

  - thomas