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

st: How to calculate a new variable (interaction term) in ml model

From   "Marko Bender" <>
To   <>
Subject   st: How to calculate a new variable (interaction term) in ml model
Date   Tue, 10 Mar 2009 16:05:47 +0100

Dear stata users,

I?m trying to estimate a recursive multi-equation model with cmp.
In the first equation  I would like to estimate a variable Y1 (dependent
variable). Then I would like to include this variable as an independent
variable in equation two. So far this is not a problem.
The problem is that I also want to include Y1 as an interaction term with
another variable X4. In order to do that I think I would need to generate a
new variable, which includes the interaction term (X4*Y1). Unfortunately
stata does not allow for any calculations within equations.

Does anybody know how to do that? Does anybody know a work-around?

The model looks like this:

cmp (Eq2: Y2 = Y1 X4 X4*Y1)  (Eq1: Y1 = X1 X2 X3), ind($cmp_cont $cmp_cont)

The equations are defined according to the ml model eq syntax. So one
thought of mine was to include a third equation, which generates my
interaction term. Unfortunately I did not find a way to do that so far.

I would be really greatefull for any suggestions and help!!!

Thanks a lot,

*   For searches and help try:

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