[R] crosstable and regression for survey data (weighted)
haps
halptekin at gmail.com
Thu Jun 21 13:02:09 CEST 2012
I have survey data that I am working on. I need to make some multi-way tables
and regression analyses on the data. After attaching the data, this is the
code I use for tables for four variables (sweight is the weight variable):
> a <- xtabs(sweight~research.area + gender + a2n2 + age)
> tmp <- ftable(a)
Is this correct? I don't think I need to use the strata and cluster
variables, right?
And, below is the logistic regression code that I use for randomly sampled,
or unweighted, data:
> logit.1 <- glm(var4 ~ var3 + var2 + var1, family = binomial(link =
> "logit"))
> summary(logit.1)
But how can I do the same analyses for the weighted data? Here is some
additional info: There are four variables in the dataset that reflect the
sampling structure. These are
strat: stratum (urban or (sub-county) rural).
clust: batch of interviews that were part of the same random walk
vill_neigh_code: village or neighbourhood code
sweight: weights
--
View this message in context: http://r.789695.n4.nabble.com/crosstable-and-regression-for-survey-data-weighted-tp4634083.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list