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 on April 23, and its replacement, is already up and running.

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

st: new explanatory variable in a loop

From   Rodrigo Briceño <>
Subject   st: new explanatory variable in a loop
Date   Tue, 7 Dec 2010 12:19:27 -0600

Hello again Stata listers. I am running several regressions (stata
9.2, windows XP) that contains a set of dummies (each dummy is defined
as a "d" plus the identification number of the bond considered. So for
id3, the dummy is d3, and so on. I made the following loop (this is a
shortened version; the original include tests and exporting
coefficients using estimates store and estout):

loc X = "sap liqmk m2-m12 mes pprom"
local isin "3 4 247 1 5 6"
foreach i of local isin	{
quietly regress liq `X' if isin2==`i'

My question to the list is: can I include something like d`i'  as a
new explanatory variable? What I need is that each regression include
its corresponding dummy, so I can do the process automatically instead
of typing individual commands:

regress liq sap liqmk m2-m12 mes pprom d3 if isin2==3
regress liq sap liqmk m2-m12 mes pprom d4 if isin2==4


Rodrigo Briceño
SKYPE: rbriceno1087

*   For searches and help try:

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