Thursday, February 16, 2006

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

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

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

___________________________________________________________ Win a BlackBerry device from O2 with Yahoo!. Enter now. * * For searches and help try: * * *


Links to this post:

Create a Link

<< Home

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