| Date: | Thu, 29 Jun 2000 11:04:38 +0200 |
| Reply-To: | John Hendrickx <J.Hendrickx@MAILBOX.KUN.NL> |
| Sender: | "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU> |
| From: | John Hendrickx <J.Hendrickx@MAILBOX.KUN.NL> |
| Subject: | Re: Deviation & Poisson |
| Content-type: | text/plain; charset="us-ascii"; format=flowed |
|---|
--- "M. MILLS" <m.mills@FRW.RUG.NL> wrote:
> Hello everyone,
> I would like to use 'deviation' coding and assume a 'Poisson' Model
> in a model I am running. I have two interrelated questions
> regarding
> the GENLOG and LOGLINEAR options.
> 1. Is it possible to specify 'DEVIATION' coding of covariates
> within
> the GENLOG command?
There's no *easy* way to specify deviation coding of categorical variables
(covariates aren't coded, they're simply included as a column of the design
matrix). There are two ways to get deviation coding in GENLOG. Either
create dummy variables yourself for all effects in the model or use the
GLOR option, which amounts to more or less the same thing. Here's a sample
program using the GLOR option in GENLOG to get Generalized Log Odds Ratios
using the deviation contrast. These have the same values as the estimates
using LOGLINEAR and the default deviation contrast.
The same results could be obtained in GENLOG by not dividing d1 to o4 by 4
and multiplying d1o1 to d3o4 by 16. These would then be dummy variables for
the deviation contrast, i.e. value 1 for the category, -1 for the redundant
category, 0 elsewhere. Enter these as cell covariates with no other effects
in the design, and you'll get deviation contrast parameters. This is
slightly easier than the GLOR option, I don't really see what use that
option has.
> 2. I know that LOGLINEAR uses deviation coding as the default. If
> I
> use LOGLINEAR instead of GENLOG, however, is it possible to
> specify a 'POISSON' model within the LOGLINEAR syntax, or does it
> automatically assume a 'multinomial' model?
A multinomial model is preferable to a poisson model, although in practice
the differences are negligible.
> Any comments or suggestions are appreciated.
If you want deviation contrast parameters, use loglinear. Here's a sample
program showing how to use GLOR, for what it's worth (English readers
please ignore Dutch labels):
Good luck,
John Hendrickx
------------------------------------
data list free / d o freq.
weight by freq.
var labels d 'dagblad' / o 'opleiding' /.
value labels
d 0 'geen' 1 'regionaal' 2 'nationaal' 3 'beide' /
o 1 'basis' 2 'voortgezet lager' 3 'voortgezet hoger' 4 'hoger'.
compute d1=((d=1)-(d=0))/4.
compute d2=((d=2)-(d=0))/4.
compute d3=((d=3)-(d=0))/4.
compute o1=((o=1)-(o=2))/4.
compute o2=((o=2)-(o=3))/4.
compute o3=((o=3)-(o=4))/4.
compute d1o1=d1*o1*16.
compute d1o2=d1*o2*16.
compute d1o3=d1*o3*16.
compute d2o1=d2*o1*16.
compute d2o2=d2*o2*16.
compute d2o3=d2*o3*16.
compute d3o1=d3*o1*16.
compute d3o2=d3*o2*16.
compute d3o3=d3*o3*16.
begin data.
0 1 38 0 2 61 0 3 53 0 4 11
1 1 73 1 2 155 1 3 160 1 4 48
2 1 20 2 2 39 2 3 82 2 4 56
3 1 9 3 2 43 3 3 40 3 4 30
end data.
genlog d o
/criteria delta(0)
/print estim
/glor d1 to d3o3
/design d o d by o.
* Box 2.6.
loglinear d (0,3) o (1,4)
/criteria delta(0)
/contrast (d) simple (1)
/contrast (o) repeated
/print estim
/design d o d by o.
|