Tuesday, March 07, 2006

Re: st: RE: loglinear models and survey data

Brian wants to know how to handle non-integer weights in the contract statement. The survey programs need the sum of the weights for each grouped obserrvation In a separate step, create the SUM of the weights within each cross-tab group:

e.g.

egen new_wt=sum(analwt_c), by( cigever alcever mjever) tempfile t1 keep cigever alcever mjever new_wt sort cigever alcever mjever save `t1', replace

use original data contract cigever alcever mjever, freq(count)

sort cigever alcever mjever merge cigever alcever mjever using `t1' // or see neat ado file "mmerge" tab _merge

drop _merge save.....

Now run svy poisson

However, note that svy poisson does not do multinomial log-linear modeling, but weights with Poisson weights. So these are not quite the same as you would get with a standard log-linear model program, but the differences between log-likelihoods should be similar.. See "ipf" by J. Mander, which states that it uses a multinomial weighting.

Steve Samuels

Only fweights are allowed qua weights. But you can specify non-integer variables, even string variables, in the varlist.

If pweights are not constant within cells of your cross-classification, what happens in terms of the -glm- call?

Nick n.j.cox@durham.ac.uk

Brian P. Flaherty

> > 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. >

* * 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/


Tag:


Links to this post:

Create a Link



<< Home

This page is powered by Blogger. Isn't yours?