Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: run cross-sectional regression for a subset of panel data
From
Richard Goldstein <[email protected]>
To
[email protected]
Subject
Re: st: run cross-sectional regression for a subset of panel data
Date
Wed, 06 Nov 2013 16:37:42 -0500
have you looked at the -statsby- command?
Rich
On 11/6/13, 4:35 PM, Huanhuan Shi wrote:
> Dear Statalist,
>
> I've been tried to solve this problem with a few lines of command but
> failed. Could you please give me some suggestions?
> The problem is: I have panel data with firms and years and I have a
> variable called sales. I want to create a new variable called coeff.
> The way to get coeff is: For firm i at time t, run a regression using
> firm i's past 5 years sales as dependent variable and use 5, 4, 3, 2,
> 1 as independent variable. For this cross sectional regression with
> only 5 datapoints, I want to collect the coefficent of sales as the
> new variable coeff. By repeating this procedure for each firm i at
> time t, coeff is created.
>
> Thank you so much for your help!!!!!
>
> Best,
>
> Lucy
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/