I think that -contract- leading to -glm- is indeed the
best route. One of the details of -contract-, the -zero-
option, was included with this very task in mind.
I am not clear on the difficulty with pweights. Can't
you just include the weight variable in the list supplied
to -contract-? I don't think you need a separate handle
to treat them differently.
-svy- I leave to its own experts.
Nick
[email protected]
Brian P. Flaherty
> First, am a new Stata user and still very much working on all
> aspects
> of the language/program.
>
> I am trying to fit loglinear models to some US national data (the
> NHSDA). The data have weights and sample design variables.
> I'd like
> to incorporate both in the analysis. I think I've learned the
> following:
>
> - to fit a standard loglinear model, use contract to get the count
> data and then xi: glm to fit the model
>
> (I'm open to correction from the start. If that is wrong or there
> are better ways to do this, please let me know.)
>
> However, this doesn't include weights or design information. And
> here are the issues that seem to confront me:
>
> - Ignoring survey design:
> The command contract does not seem to be able to include
> pweights (Is
> this something I could add to the ado file, being such a new user?)
>
> - Including survey design (svyset):
> Can I use svy: poisson on the individual case data? If so, what is
> the dependent variable? (There is no count variable as in the cross-
> tabulated data used in glm.)
>
> Or is there a way to use contract in the survey context, have
> it keep
> the design variables, and then use svy: poisson on the counts as the
> dependent variable?
>
> Other ways to do this would be greatly appreciated. Thank you for
> your time and thoughts.
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/