Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

RE: st: Regression by industry and year excluding firm i

From   "Abdalla, Ahmed" <>
To   "" <>
Subject   RE: st: Regression by industry and year excluding firm i
Date   Fri, 13 Dec 2013 19:09:31 +0000

I forgot to mention that I have a total of 95,000 observations. After 45 minutes, I enforced STATA to stop(break) and I realized that some values have been reported in b0 to b6.. I am not sure if this is normal ? Do you think that the code should be OK ? also do I need to write } } } (three times) at the end. I believe that you closed each loop above, so why do you write this again at the end.

Many thanks

From: <> on behalf of Scott Merryman <>
Sent: 13 December 2013 18:00
Subject: Re: st: Regression by industry and year excluding firm i

On Fri, Dec 13, 2013 at 11:33 AM, Abdalla, Ahmed
<> wrote:
> Dear Statalist
> I run a regression to estimate core earnings for each variable in my dataset. The regression is run using all observations in a particular industry year EXCLUDING firm i. Expected core earnings for firm i is estimated using the coefficients multiplied by the actual values of variables in the model for firm i.


Do you mean something like this:

webuse grunfeld,clear
gen invest_hat  = .
levelsof company, local(levels)
foreach l of local levels {
   reg invest mvalue kstock if company != `l'
   predict fitted if company == `l'
   replace invest_hat = fitted if company == `l'
   drop fitted


*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index