Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "felix kreppel" <felix.kreppel@gmx.de> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: Regression with different firms |
Date | Thu, 09 Aug 2012 20:44:29 +0200 |
I tried the following commmand: reshape long firm std, i(date) j(firm) This seems to work. My dataset, however, is quite large (1000 firms & 1000 volatilites). It seems as if Stata cannot perform the conversion. Am I doing something wrong, or is there another way to do this? The regression command I would end up with after reshaping would be regress firm std market_return, right? Thanks. -------- Original-Nachricht -------- > Datum: Thu, 9 Aug 2012 14:34:09 -0400 > Von: Fernando Rios Avila <f.rios.a@gmail.com> > An: statalist@hsphsun2.harvard.edu > Betreff: Re: st: Regression with different firms > Exactly. You might end up with a data set that looks like: > Year firm_id return std market_return > 1985 1 > 1985 2 > 1985 3 > 1986 1 > just check the reshape examples from wide to long. > and if you tried already something, send the commands you have tried, > so its possible to tell you where is the syntaxis mistake. > Fernando > On Thu, Aug 9, 2012 at 2:21 PM, felix kreppel <felix.kreppel@gmx.de> > wrote: > > Hello Fernando, > > > > Thank you for your quick response. > > > > I thought of this. Do you mean, that I should reshape my dataset in the > following way? > > > > > > year return std market_return > > firm1 1985 > > 1986 > > 1987 > > firm2 1985 > > 1986 > > 1987 > > > > and then run a simple linear regression? > > > > I tried different reshape commands-, but none of them seems to work.. > > > > -------- Original-Nachricht -------- > >> Datum: Thu, 9 Aug 2012 14:01:33 -0400 > >> Von: Fernando Rios Avila <f.rios.a@gmail.com> > >> An: statalist@hsphsun2.harvard.edu > >> Betreff: Re: st: Regression with different firms > > > >> Felix, > >> Look at -help reshape- > >> HTH > >> Fernando > >> On Thu, Aug 9, 2012 at 1:58 PM, felix kreppel <felix.kreppel@gmx.de> > >> wrote: > >> > > >> > Hello, > >> > > >> > I have regression problem: > >> > > >> > I have a dataset consisting of yearly firm returns (for firm1-firm3) > and > >> the volatility of each firm in that month(std1-std3) and a data on a > >> monthly market return (market_return) over a specific timepriod. > >> > > >> > No I want to estimate the following regression over the whole time > >> period: > >> > > >> > return_firm_i = a*std_i + b* market_return > >> > > >> > Its not a problem to do this with only one firm: > >> > > >> > regress firm1 std1 market_return, robust > >> > > >> > However, I want to do this for the whole dataset and estimate single > >> coefficients. > >> > > >> > Could somebody help me? > >> > > >> > > >> > My dataset looks like this: > >> > > >> > date firm1 firm2 firm3 std1 std2 std3 market_return > >> > 1985 0.03 0.04 0.05 0.3 0.4 0.5 0.6 > >> > 1986 .. > >> > 1987 ... > >> > > >> > Thanks in advance! > >> > > >> > * > >> > * For searches and help try: > >> > * http://www.stata.com/help.cgi?search > >> > * http://www.stata.com/support/statalist/faq > >> > * http://www.ats.ucla.edu/stat/stata/ > >> * > >> * For searches and help try: > >> * http://www.stata.com/help.cgi?search > >> * http://www.stata.com/support/statalist/faq > >> * http://www.ats.ucla.edu/stat/stata/ > > * > > * For searches and help try: > > * http://www.stata.com/help.cgi?search > > * http://www.stata.com/support/statalist/faq > > * http://www.ats.ucla.edu/stat/stata/ > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/