Bookmark and Share

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]

st: RE: RE: Difference Model


From   Nick Cox <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: RE: Difference Model
Date   Wed, 2 Nov 2011 00:09:30 +0000

Except that I guess this only makes sense within -firmid-. 

So, you could do this: 

... if d.h1 

or 

bysort firmid (year) : gen isdifferent = h1 != h1[_n-1]

... if isdifferent 

Whether the first observation in each panel is regarded as different from the previous is also a small issue. 

Nick 
[email protected] 


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Nick Cox
Sent: 01 November 2011 23:48
To: '[email protected]'
Subject: st: RE: Difference Model

I don't see how you think we can help. There is no context here and no explanation of why any model might make sense for whatever is your research problem. 

If you are saying that you want to select times at which -h1- differs from its previous value then 

... if h1 != h1[_n-1] 

selects such observations. 

Nick 
[email protected] 

vikramfinavker

I have a data like this...

year  firmid h1 x1 x2    x3 x4  x5
1998     1      0  1    10 
1999     1      0  1    11
2000     1      0  1    12
2001     1      0  1    12
2002     1      1  1    13
2003     1      1  1    18
2004     1      1  1    17
2005     1      1  1    16
2006     1      1  1    15
2007     1      1  1    14
1998     2      0  1    10 
1999     2      0  1    11
2000     2      0  1    12
2001     2      0  1    12
2002     2      0  1    13
2003     2      0  1    18
2004     2      1  1    17
2005     2      1  1    16
2006     2      1  1    15
2007     2      1  1    14

Now i want to run regression using following way;
reg x3 h1 x2

but i want to use only those observations where variables "h1" changes to
either "1" or "0". can i use first difference model.? Does it help me in
this case? can i run regression like:

reg x3 d.h1 x2 

or do i have to run it like this

reg d.x3 d.h1 d.x2

Please let me know if you can help.


*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index