Hi all,
My question is about a panel data set for which in would like to regress a certain monthly score on holding period returns of equities. I'm getting to know Stata step by step and have done some reshaping and cleaning already but I cant seem to find the right way to handle this last part. Im dealing with 4 different monthly scores (0-100) and monthly holding period returns for 1000 equities in a time frame of 10 years.
The problem is the structure of the current dataset has a separate time variable for each combination of date - firm - 1/4 scores, which causes 4 identical date observations per company & return combination. I would like to ask for a way to delete the 'missing values' and combine the 4 score variables with 1 date variable row per firm.
The data currently looks like this:
Date TICKER CUSIP PERMNO RET combined environment social governance
2019m10 A 00846U10 87432 -.011483718 . . . 84.38
2019m10 A 00846U10 87432 -.011483718 79.34
2019m10 A 00846U10 87432 -.011483718 . . 94.51 .
2019m10 A 00846U10 87432 -.011483718 88.32
2019m11 A 00846U10 87432 .066270582 . 79.96 . .
2019m11 A 00846U10 87432 .066270582 83.22
2019m11 A 00846U10 87432 .066270582 87.58 .
2019m11 A 00846U10 87432 .066270582 93.6 .
2019m12 A 00846U10 87432 .058437552 83.22
2019m12 A 00846U10 87432 .058437552 79.96
2019m12 A 00846U10 87432 .058437552 87.58
2019m12 A 00846U10 87432 .058437552 93.6
2017m1 AAIC 04135620 85653 .010121496 15.75
2017m1 AAIC 04135620 85653 .010121496 0
2017m1 AAIC 04135620 85653 .010121496 25.17
2017m1 AAIC 04135620 85653 .010121496 10.18
2017m2 AAIC 04135620 85653 -.015364095 10.18
2017m2 AAIC 04135620 85653 -.015364095 25.17
2017m2 AAIC 04135620 85653 -.015364095 15.75
2017m2 AAIC 04135620 85653 -.015364095 0
2017m3 AAIC 04135620 85653 .001017662 25.17
2017m3 AAIC 04135620 85653 .001017662 15.75
2017m3 AAIC 04135620 85653 .001017662 10.18
2017m3 AAIC 04135620 85653 .001017662 0
2017m4 AAIC 04135620 85653 .030431727 15.75
I think it might be important to mention that the data is not complete for all dates or scores for some firms, also the order of the (non-missing) scores is not consistent.
Appreciate any help or tips, thank you very much in advance.
Related Posts with repeated time values within panel: combining rows with the same date
How to calculate institutional investor churn rate and investor turnoverHello My study looks at investor horizon and return predictability. I tried checking the posts on ho…
Generating new observation for all id's in panel dataDear Stata community, can you help me with this issue of adding a generated observation to the data …
Multilevel model: REML or robust SE's?My apologies for the silly question: I've been running a mixed effects model and since I have a smal…
Median incomeHi folks, The data below is a sample survey data. How do i generate the median annual income per ye…
spatial econometricsGood afternoon someone knows how its possible to use a panel data with spatial econometrics ? what …
Subscribe to:
Post Comments (Atom)
0 Response to repeated time values within panel: combining rows with the same date
Post a Comment