Hello all,
I'm pretty new to stata and am currently writing my Bachelor Thesis, but I am already running into some issues early on.
I have collected all of my variables from Eikon and am now looking to merge them together so that I can start running my regressions. All of my variables except for one are in the same order (panel data) but one of my variables came back in a wide form. I'm currently trying to reshape this into a long form but after troubleshooting for a little while, I ran into my final error that I cannot seem to get fixed. The code and output is as follows:
Its probably a minor mistake but I just can't seem to figure it out. I looked at my ISIN values and they look normal.
Thanks for your time,
Jesse
I'm pretty new to stata and am currently writing my Bachelor Thesis, but I am already running into some issues early on.
I have collected all of my variables from Eikon and am now looking to merge them together so that I can start running my regressions. All of my variables except for one are in the same order (panel data) but one of my variables came back in a wide form. I'm currently trying to reshape this into a long form but after troubleshooting for a little while, I ran into my final error that I cannot seem to get fixed. The code and output is as follows:
. reshape long FY, i(ISIN) j(quarter, string)
(note: j = 2005Q1 2005Q2 2005Q3 2005Q4 2006Q1 2006Q2 2006Q3 2006Q4 2007Q1 2007Q2 2007Q3 2007Q4 2008Q1 2008Q2 2008Q3 2008Q4 2009Q1 2009Q2 2009Q3 2009Q4 2010Q1 2010Q2 2010Q3 2010
> Q4 2011Q1 2011Q2 2011Q3 2011Q4 2012Q1 2012Q2 2012Q3 2012Q4 2013Q1 2013Q2 2013Q3 2013Q4 2014Q1 2014Q2 2014Q3 2014Q4 2015Q1 2015Q2 2015Q3 2015Q4 2016Q1 2016Q2 2016Q3 2016Q4 201
> 7Q1 2017Q2 2017Q3 2017Q4 2018Q1 2018Q2 2018Q3 2018Q4 2019Q1 2019Q2 2019Q3 2019Q4 2020Q1 2020Q2 2020Q3 2020Q4)
variable id does not uniquely identify the observations
Your data are currently wide. You are performing a reshape long. You specified i(ISIN) and j(quarter). In the current wide form, variable ISIN should uniquely identify
the observations. Remember this picture:
long wide
+---------------+ +------------------+
| i j a b | | i a1 a2 b1 b2 |
|---------------| <--- reshape ---> |------------------|
| 1 1 1 2 | | 1 1 3 2 4 |
| 1 2 3 4 | | 2 5 7 6 8 |
| 2 1 5 6 | +------------------+
| 2 2 7 8 |
+---------------+
Type reshape error for a list of the problem observations.
(note: j = 2005Q1 2005Q2 2005Q3 2005Q4 2006Q1 2006Q2 2006Q3 2006Q4 2007Q1 2007Q2 2007Q3 2007Q4 2008Q1 2008Q2 2008Q3 2008Q4 2009Q1 2009Q2 2009Q3 2009Q4 2010Q1 2010Q2 2010Q3 2010
> Q4 2011Q1 2011Q2 2011Q3 2011Q4 2012Q1 2012Q2 2012Q3 2012Q4 2013Q1 2013Q2 2013Q3 2013Q4 2014Q1 2014Q2 2014Q3 2014Q4 2015Q1 2015Q2 2015Q3 2015Q4 2016Q1 2016Q2 2016Q3 2016Q4 201
> 7Q1 2017Q2 2017Q3 2017Q4 2018Q1 2018Q2 2018Q3 2018Q4 2019Q1 2019Q2 2019Q3 2019Q4 2020Q1 2020Q2 2020Q3 2020Q4)
variable id does not uniquely identify the observations
Your data are currently wide. You are performing a reshape long. You specified i(ISIN) and j(quarter). In the current wide form, variable ISIN should uniquely identify
the observations. Remember this picture:
long wide
+---------------+ +------------------+
| i j a b | | i a1 a2 b1 b2 |
|---------------| <--- reshape ---> |------------------|
| 1 1 1 2 | | 1 1 3 2 4 |
| 1 2 3 4 | | 2 5 7 6 8 |
| 2 1 5 6 | +------------------+
| 2 2 7 8 |
+---------------+
Type reshape error for a list of the problem observations.
Thanks for your time,
Jesse
Comment