[Limdep Nlogit List] Creating A Loop

William Greene wgreene at stern.nyu.edu
Wed Sep 26 01:57:16 EST 2007


In LIMDEP 9 and NLOGIT 4, you can use
CREATE ; Xbari = GroupMean(X,Str=Y) $
In earlier versions, it takes 3 lines;
REGR;LHS=ONE;RHS=ONE;STR=Y;PANEL $
MATRIX ; Means = GXBR(X,_Stratum) $
CREATE ; Xbari = Means(_Stratum) $
/B. Greene

----- Original Message -----
From: "Abdulbaki Bilgic" <tebrik at yahoo.com>
To: "Limdep and Nlogit Mailing List" <limdep at limdep.itls.usyd.edu.au>
Sent: Tuesday, September 25, 2007 5:04:49 AM (GMT-0500) America/New_York
Subject: [Limdep Nlogit List] Creating A Loop

Hello All,
I think i have a simple problem on functioning an appropriate loop
procedure. Suppose i have two variables Y and X:
Y                       X
0                      3.4
0                      4.5
0                      1.5
2                      3
2                      4
3                      5
3                      6
3                      7
5                      2
5                      2
I would like to create an additional variable representing an average
value of X when Y=j, where j=0,2,3,5 in this case. For example,
Y                       X           Z
0                      3.4          A
0                      4.5          A
0                      1.5          A 
2                      3            B
2                      4            B
3                      5            C
3                      6            C
3                      7            C
5                      2            D
5                      2            D
Where A is XBAR(X) When Y=0 and so forth. I know how to handle this in
Gauss but i never tried in LIMDEP. Any advice on how to compute this
would be greatly appreciated.

Thanks in advance,

Bilgic




      ____________________________________________________________________________________
Catch up on fall's hot new shows on Yahoo! TV. Watch previews, get listings, and more!
http://tv.yahoo.com/collections/3658 
_______________________________________________
Limdep site list
Limdep at limdep.itls.usyd.edu.au
http://limdep.itls.usyd.edu.au


-- 
Professor William Greene
Department of Economics
Stern School of Business
New York University
44 West 4th St., Rm. 7-78
New York, NY   10012
http://www.stern.nyu.edu/~wgreene
212.998.0876




More information about the Limdep mailing list