[Limdep Nlogit List] Creating A Loop

William Greene wgreene at stern.nyu.edu
Wed Sep 26 04:22:10 EST 2007


If you mean for that observation with Y=0 at the end to
be part of the group at the beginning, then yes, you must
sort the data.  Likewsie for those two 10s. The command 
is
SORT ; LHS = Y ; RHS = * $
to sort on Y carrying all other variables.
/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 12:50:50 PM (GMT-0500) America/New_York
Subject: Re: [Limdep Nlogit List] Creating A Loop

Dear Dr. Greene,
Thank you for your kind help. I have NLOGIT 4. I run what you have
already suggested and listed few observations below, but it seems to me
i should have descended Y before doing this.
            Y       X          Z=XBAR(X)
            0      .03129      .03107
            0      .03083      .03107
            0      .03085      .03107
            0      .03102      .03107
            0      .03134      .03107
            0      .03106      .03107
            0      .03107      .03107
           20      .02861      .02313
           20      .01765      .02313
           10      .03010      .03010
           15      .02452      .02762
           15      .03072      .02762
            0      .03078      .03078
           10      .03036      .03036
Bilgic
  
> 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
> 
> _______________________________________________
> Limdep site list
> Limdep at limdep.itls.usyd.edu.au
> http://limdep.itls.usyd.edu.au
> 



      ____________________________________________________________________________________
Tonight's top picks. What will you watch tonight? Preview the hottest shows on Yahoo! TV.
http://tv.yahoo.com/ 

_______________________________________________
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