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 at the end of May, and its replacement, statalist.org is already up and running.


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

RE: st: RE: combination of rolling and if


From   Nick Cox <n.j.cox@durham.ac.uk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   RE: st: RE: combination of rolling and if
Date   Wed, 14 Dec 2011 14:26:48 +0000

In addition, my advice in my first reply to you still stands.  

-if- preselects observations before doing anything. Other observations won't be added in later for any reason. 

If -if- bites you too hard, don't use it. 

As said, I can't comment specifically on commands I can see, but this is a general Stata principle, already explained to you. 

Nick 
n.j.cox@durham.ac.uk 


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox
Sent: 14 December 2011 14:19
To: 'statalist@hsphsun2.harvard.edu'
Subject: RE: st: RE: combination of rolling and if

We can't see your data and you do not show your exact detailed commands. 

So we have no chance of reproducing your results and little chance of understanding _precisely_ what -if ST == 1- means. 

Please read the Statalist FAQ again for advice on posting questions that can be answered. 

Your best chance of getting good specific feedback is to replicate your problem with a concocted dataset or with one downloadable into Stata by everyone. -help q_cross- shows what panel datasets there are. 

Nick 
n.j.cox@durham.ac.uk 

qing ye

I found that if I use if with tssmonth , what it does is still,
for every month, calulate average return for the next 12 months for
the observations whose 'ST'==1 at each period.

But this is not what I want,  I want to take the stocks whose current
period 'ST'==1 and calculate the returns for this group over the next
12 months. so my group of stocks are those whose current period
'ST'==1, I don't care whether their 'ST'==1 or not in any of the next
12 period.  But -if- seems only care whether 'ST'==1 in the periods
included in the 'windows'.

How do I solve this?


*
*   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