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: Decile means

From   "Katharina (gmx)" <>
To   <>
Subject   st: Decile means
Date   Wed, 14 Nov 2012 16:54:01 +0100

Dear Statalist,

I would like to perform two regressions based on the same panel data. In fact, I am only interested in the intercept estimate from both regressions. Is it possible to simultaneously "statsby" them into the same output file or do I have to merge the outputs afterwards?

Then, I would like to build deciles based on the first intercept estimations (alpha) and calculate the mean within these deciles of both the first (alpha) and the second estimates (alpha'). This is my code so far, it generates the alpha means within the alpha deciles:

sort alpha
foreach X of varlist alpha {
   xtile deciles=`X', n(10)
   bysort deciles: egen D`X'=mean(`X')
   drop deciles

Still I don't succeed in calculating the mean of alpha' within the alpha deciles (maybe something like bysort deciles: egen Dalpha_= mean(alpha_) if deciles=`X' within the foreach loop?). I appreciate are any suggestions! Thank you very much, Katharina
*   For searches and help try:

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