Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: loglinear models and survey data

From   "Nick Cox" <>
To   <>
Subject   st: RE: loglinear models and survey data
Date   Thu, 29 Sep 2005 21:13:39 +0100

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.


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:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index