Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: ologit_interaction_duplicate enetries found


From   Sanam P <sanamp25@yahoo.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: ologit_interaction_duplicate enetries found
Date   Sun, 22 May 2011 02:52:19 -0700 (PDT)

Dear Stata list members
 
I have used an ordered logistic model, using ologit, with interactions included 
in the model. 
 
 xi:ologit  y    i.a*i.b   i.c   i.d   i.e   i.a*i.f   i.a*i.g  ,or
 
And I have received below error:
 
initial vector: duplicate entries for y:o._Ia_2 found

 
I saw below qusetion, which was very similar to my question,  in the below 
email, and Maarten's answer to it, when I was searching for an answer to my 
question (please see below emails).

 The only difference is that in my case both variables in the interactions are 
categorical. So I tried:
 
xi:ologit  y    i.a*i.b   i.c   i.d   i.e   i.a|i.f   i.a|i.g  ,or
 
but I received below error:
 
 
I.xxx|I.yyy not allowed
 
 
Apparently this only works when one of the covariates included in the 
interactions is countiniuos (as it was in the below question in the below 
email).

Is there any other way for including interactions to prevent this error? Any 
help would be greatly appreciated.
 
Many thanks,
Sanam
 




From  Maarten buis <maartenbuis@yahoo.co.uk>
To  statalist@hsphsun2.harvard.edu
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
 
--- lm335@drexel.edu 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?

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index