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, statalist.org is already up and running.


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

Re: st: Regression with different firms


From   Fernando Rios Avila <f.rios.a@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Regression with different firms
Date   Thu, 9 Aug 2012 14:51:25 -0400

No, your command is wrong. it should be:
reshape long firm std, i(date) j(firm_id)
For your regression, that seems to be correct as a starting point.
Fernando

On Thu, Aug 9, 2012 at 2:44 PM, felix kreppel <felix.kreppel@gmx.de> wrote:
> 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/
*
*   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/


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