Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: loglinear models and survey data

From   Steven Samuels <>
Subject   Re: st: RE: loglinear models and survey data
Date   Mon, 6 Mar 2006 19:19:21 -0500

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


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
tab _merge

drop _merge

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?


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:

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