Page 1 of 1

sample command in panel

Posted: Tue Aug 04, 2015 4:33 am
by JhonnyCa
Hi,
I'm using a dated panel with monthly observations and 2000 cross-sections (stocks). How can I "mark" certain cross sections by looking at a variable (e.g. market cap.>100) in one month, t, and take the same cross-sections in a sample command the next month, t+1, (even though their market cap. has for example decreased in month t+1 and would no longer fulfill the original if-condition from month t).
I hope I have been clear, I would very appreciate any help!

Re: sample command in panel

Posted: Tue Aug 04, 2015 5:10 am
by JhonnyCa
So if, for example, the following sample command for month 10 (trend=10) yields 200 stock-months...

smpl @all if trend=10 and if marketcap<100

...I then want to include the same 200 stocks in month 11 (trend=11), regardless the value of their marketcap

Re: sample command in panel

Posted: Tue Aug 04, 2015 7:45 am
by EViews Glenn
If I understand correctly, I think something like this should work.

Code: Select all

smpl @all series keep = @recode(@trend=10 and marketcap<100, 1, 0) smpl if @sumsby(keep, @crossid)>0