Statalist The Stata Listserver


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

Re: st: Using xi: for interaction terms in gllamm


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: Using xi: for interaction terms in gllamm
Date   Thu, 16 Feb 2006 21:49:21 +0000 (GMT)

Hi Leny,

The problem is that -xi: whatevercommand i.var1*var2- enteres all the main and interaction
effects, so if you type -xi: whatevercommand i.var1*var2 i.var1*var3- the main effect of var1 will
be entered twice, and -gllamm- chocked on that. you can prevent that by typing -xi:
whatevercommand i.var1*var2 i.var1|var3-. see example below:

*------------begin example-------------
sysuse auto, clear
gen mpg2 = mpg^2

xi: reg price i.foreign*mpg i.foreign*mpg2
*note that _Iforeign_1 is entered twice and one is droped

xi: reg price i.foreign*mpg i.foreign|mpg2
* note that _Iforeign_1 is entered once
*-----------end example-------------------

HTH,
Maarten

--- [email protected] wrote:
> Stata gave me an error when I tried to include an interaction term of time^2 with group variable
> as given below.
> 
> xi: gllamm CRH_  i.groups*time  i.groups*timesq,  i(studyid) nrf(2) nip(12) eqs(inter slope)
> family(gamma) link(log) adapt 
> 
> 
> Running adaptive quadrature
> Iteration 0:    log likelihood = -2787.6297
> initial vector: duplicate entries for CRH_:_Igroups_1 found
> 
> 
> Is there  a different way of including the interaction term without explicitly creating the
> terms and the using them?


-----------------------------------------
between 1/2/2006 and 31/3/2006 I will be
visiting the UCLA, during this time the
best way to reach me is by email

Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting adress:
Buitenveldertselaan 3 (Metropolitan), room Z214

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


		
___________________________________________________________ 
Win a BlackBerry device from O2 with Yahoo!. Enter now. http://www.yahoo.co.uk/blackberry
*
*   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/



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