Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

st: Interactions in xreg

From   Morten Hesse <>
Subject   st: Interactions in xreg
Date   Mon, 23 Aug 2010 10:02:30 +0200

I found something that puzzles me.

I have data, where subjects are tested in 5 blocks. Subjects vary on variable "ant" (dummy coded). I want to test of there is a curvi-linear effect of "ant" on outcome igt.
blocksq=block^2 (to test curvi-linearity).


. xtreg igt ant block blocksq ant*blocksq age gender, mle

Gives me as a result an output, where I have parameters for each variable, including two for asp*blocksq, but only one for asp*block. No error message.

"block" is a float variable format %9.0g
"blocksq" is a float varible format %9.0g

Any ideas why I get two coefficients for one interaction, but only one for the other?

Would it be wrong of me to estimate the interactions simply as variables that I calculate "by hand", i.e. newvariable=ant*block, newvariable=ant*block^2, and enter those in stead of the interactions as determined by Stata.

Any help is appreciated.

Den 20-08-2010 17:05, Steve Samuels skrev:
I don't really understand what you did, so I can't say much about it.

You say that Stata is taking much time---to do what? How do you know
it's your data set up and not something else? The list FAQ request
that you show _exactly_ what you typed and what Stata produced.

Don't do a "duration" analysis. I don't what "SILC" is (and you have
not given references, as the FAQ request), but I assume that people
could be in the initial state (poverty or not) for some time prior to
the first wave. If so, the first wave is probably not a natural
origin. If you don't have dates of transitions, you have grouped data;
if you have losses to follow-up between interviews, you have interval
censoring. You do not have enough time points (only two intervals) or
information to meet the assumptions of a grouped data ("discrete")
duration analysis

Instead, I suggest that you model changes in status between waves. You
will need at most two-lines of data for every person, one for each of
the two intervals. You can have one model for transition to poverty
and a second for transition out of poverty. Use -logistic- or
-cloglog- for each model and cluster on person ID to correct standard

If you have trouble with this analysis, come back to the list. With a
potential data set-up problem, show: lines of actual data ( include
IDs but exclude most covariates, please); the Stata statements you
used to transform the data; and a listing of the final analysis data
set corresponding to the same data lines you originally showed. Keep
the dots for missing values.


Steven Samuels
18 Cantine's Island
Saugerties NY 12477
Voice: 845-246-0774
Fax: 206-202-4783

On Tue, Aug 17, 2010 at 10:57 AM, Sabrina Carrossa<>  wrote:
Hi all,

I am trying to execute a multilevel duration model.
Since Stata is taking a lot of time to give me an output, I think that
I probably did some mistakes.

I would be most grateful if you can help me.

First of all, my aim is to analyse the entering in (and then exiting
from) poverty. I used a multidimensional definition of poverty that
combine both the monetary poverty and the material deprivation in one
dummy index of "consistent poverty" (1: if poor and deprived; 0:
Since I am analysing the first three waves of SILC data, I can't study
the re-entering/re-exeting from poverty, but I am focusing on a single

I have a doubt about the input data. In order to analyse the entering
in poverty, I created the person-year Db expanding each case D-times,
using the following algorithm:

- T1, T2, T3: three waves; Values: 1 (poor) 0 (not poor) and 2
(missing, but in my Db it is ".");
- Y, Values 1 (entering in poverty) 0 (never been poor)
- D: duration

T1    T2    T3  Y       D
0       0       0       0       3
0       0       1       1       3
0       0       2       0       2

0       1       0       1       2
0       1       1       1       2
0       1       2       1       2

0       2       0       0       1
0       2       1       dropped dropped
0       2       2       0       1

1       0       0       dropped dropped
1       0       1       dropped dropped
1       0       2       dropped dropped

1       1       0       dropped dropped
1       1       1       dropped dropped
1       1       2       dropped dropped

1       2       0       dropped dropped
1       2       1       dropped dropped
1       2       2       dropped dropped

2       0       0       0       2
2       0       1       1       2
2       0       2       0       1

2       1       0       dropped dropped
2       1       1       dropped dropped
2       1       2       dropped dropped

2       2       0       0       1
2       2       1       dropped dropped
2       2       2       dropped dropped

Did I keep/drop my cases in the right way?

Thanks a lot and sorry for this very long-mail.

*   For searches and help try:


*   For searches and help try:
*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index