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: Conceptual question: treating panel data as time-series or separating the dataset?


From   Clarice Martins <[email protected]>
To   [email protected]
Subject   st: Conceptual question: treating panel data as time-series or separating the dataset?
Date   Sun, 3 Nov 2013 12:31:24 -0200

Dear Group,

Thanks to all the valuable input I have gained from the group, I have improved a lot in my learning to use Stata. 
But, with every step, comes a new challenge. (enough of niceties... sorry! :-)

I am using Stata 12.1 for Mac.

I have more of a conceptual question regarding best practice.

My dataset looks like this (below) and in my research now I will treat the data in variables -P1- and -P5- to infer information such as average, t-test, run a regression... just like a time-series now, and so I was wondering:

1)  should I convert these two variables into a total separate time-series dataset??


2) or, should try to convert this panel data to time-series??

- although, just for sake of learning, I have already tried to -tsset- the data and got this:

. tsset co_id period
repeated time values within panel

- Thanks, to the FAQ: http://www.stata.com/support/faqs/data-management/repeated-time-values/  , I was able to get to "no news" with these 2 commands below, and figured out that observations in this panel data are only uniquely identified by the combination of 3 variables: 

. bysort co_id period rtype: assert _N == 1

. isid co_id period rtype


3)  another issue is:
- As you can see (below), some of the P1 and P5 values are repeated, because they are the result of a -total(return)- for a given set of conditions (for example: -quintile==1 & rtype=="buy_sell_period").  

- I do need to add up values for -P1- and -P5- for same dates before proceeding with regression operations, should I just create another variable for this, and what is the right away to handle the repetitions?

*------------------snapshot of dataset-----------
co_id	ticker	yrmonth	rtype	return	quintile	P1	P5
14	BRSR6	2000m8	buy_sell_period	0.25	1	.8269165	.
17	CEEB3	2000m8	buy_sell_period	0.23	1	.8269165	.
64	USIM5	2000m8	buy_sell_period	0.07	1	.8269165	.
51	OIBR4	2000m8	buy_sell_period	0.19	1	.8269165	.
4	BBAS3	2000m8	buy_sell_period	-0.01	1	.8269165	.
35	GGBR4	2000m8	buy_sell_period	0.10	1	.8269165	.
28	ELET6	2000m8	buy_sell_period	-0.14	5	.	-.3151833
3	AMBV4	2000m8	buy_sell_period	0.04	5	.	-.3151833
20	CESP6	2000m8	buy_sell_period	0.05	5	.	-.3151833
16	CBEE3	2000m8	buy_sell_period	-0.19	5	.	-.3151833
33	FIBR3	2000m8	buy_sell_period	-0.08	5	.	-.3151833
14	BRSR6	2001m1	hold_period	0.35	1	.	.8117039
11	BRFS3	2001m1	hold_period	0.28	1	.	.8117039
58	SBSP3	2001m1	hold_period	0.12	1	.	.8117039
64	USIM5	2001m1	hold_period	0.28	1	.	.8117039
35	GGBR4	2001m1	hold_period	-0.03	1	.	.8117039
17	CEEB3	2001m1	hold_period	-0.18	1	.	.8117039
30	EMBR3	2001m1	hold_period	0.36	5	.9562804	.
16	CBEE3	2001m1	hold_period	-0.30	5	.9562804	.
3	AMBV4	2001m1	hold_period	0.79	5	.9562804	.
20	CESP6	2001m1	hold_period	0.16	5	.9562804	.
53	PETR4	2001m1	hold_period	-0.05	5	.9562804	.

*---------------------------end--------------------------------


Just any hint to best practice will be appreciated.

Thank you for your consideration!

Best,
Clarice



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index