[R] analysis of data with observation weights
Michal Bojanowski
bojaniss at poczta.onet.pl
Thu Nov 14 17:22:42 CET 2002
Dear R-users,
Recently I had to analyze a dataset from household survey. The sample design
ensured, that each household in the population has the same probability of being
sampled. However the data were gathered from only one adult individual in each
household, who was randomly choosen by an interviewer (via "Kish grid"). To
equalize the probabilities for each INDIVIDUAL a casewise weighting factor is
introduced. It is proportional to the reciprocal of the number of adults in the
household and rescaled so it's sum equals the sample size. This weighting factor
is neccessery to perform inferences for population of individuals.
I had no problems with estimating models which use count data, because I could
construct contingency tables with something like:
tapply(weight, a.bunch.of.factors, sum)
Unfortunately I couldn't come up with a good way of building other kinds of
models for those data. Is there some way (apart for writing new functions from
scratch) to perform modelling tasks like lm(), that will take the weights into
account?
(As far as I know there are only basic functions weighted.mean() and cov.wt()
for weighted means and weighted covariance/correlation matrices respectively.)
Thank you in advance for any suggestions.
Michal
~,~`~,~`~,~`~,~`~,~`~,~`~,~`~,~
Michal Bojanowski
Institute for Social Studies
University of Warsaw
Poland
http://www.iss.uw.edu.pl
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list