Dear all,
I have the following dataset
and I'm trying to explore the data, with the objective to have a table like the following:

Where country is the variable "loc", firms are identifies by "ISIN" over quarters ("datacqtr")
I tried with collapse function
Nevertheless I realize tha collapse doesn't have stats related to unique/distinct id identifiers.
More than happy to receive your help!
I have the following dataset
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str4 loc str12 isin str6 datacqtr "DEU" "" "2005Q1" "ITA" "" "2005Q2" "DNK" "" "2005Q3" "ITA" "" "2005Q4" "GBR" "" "2006Q1" "SWE" "" "2006Q2" "GBR" "" "2006Q3" "DEU" "" "2006Q4" "NLD" "" "2007Q1" "ITA" "" "2007Q2" "DEU" "" "2007Q3" "GRC" "" "2007Q4" "SWE" "" "2008Q1" "SWE" "" "2008Q2" "DEU" "" "2008Q3" "ITA" "" "2008Q4" "SWE" "" "2009Q1" "GBR" "" "2009Q2" "DEU" "" "2009Q3" "POL" "" "2009Q4" "SWE" "" "2010Q1" "ITA" "" "2010Q2" "NLD" "" "2010Q3" "DEU" "" "2010Q4" "DEU" "" "2011Q1" "GBR" "" "2011Q2" "DEU" "" "2011Q3" "GRC" "" "2011Q4" "POL" "" "2012Q1" "NLD" "" "2012Q2" "DEU" "" "2012Q3" "SWE" "" "2012Q4" "DEU" "" "2013Q1" "NLD" "" "2013Q2" "DNK" "" "2013Q3" "SWE" "" "2013Q4" "SWE" "" "2014Q1" "NLD" "" "2014Q2" "NLD" "" "2014Q3" "NLD" "" "2014Q4" "SWE" "" "2015Q1" "GRC" "" "2015Q2" "GBR" "" "2015Q3" "DNK" "" "2015Q4" "NLD" "ANN4327C1220" "2005Q1" "NLD" "ANN4327C1220" "2005Q2" "NLD" "ANN4327C1220" "2005Q3" "NLD" "ANN4327C1220" "2005Q4" "NLD" "ANN4327C1220" "2006Q1" "NLD" "ANN4327C1220" "2006Q2" "NLD" "ANN4327C1220" "2006Q3" "NLD" "ANN4327C1220" "2006Q4" "NLD" "ANN4327C1220" "2007Q1" "NLD" "ANN4327C1220" "2007Q2" "NLD" "ANN4327C1220" "2007Q3" "NLD" "ANN4327C1220" "2007Q4" "NLD" "ANN4327C1220" "2008Q1" "NLD" "ANN4327C1220" "2008Q2" "NLD" "ANN4327C1220" "2008Q3" "NLD" "ANN4327C1220" "2008Q4" "NLD" "ANN4327C1220" "2009Q1" "NLD" "ANN4327C1220" "2009Q2" "NLD" "ANN4327C1220" "2009Q3" "NLD" "ANN4327C1220" "2009Q4" "NLD" "ANN4327C1220" "2010Q1" "NLD" "ANN4327C1220" "2010Q2" "NLD" "ANN4327C1220" "2010Q3" "NLD" "ANN4327C1220" "2010Q4" "NLD" "ANN4327C1220" "2011Q1" "NLD" "ANN4327C1220" "2011Q2" "NLD" "ANN4327C1220" "2011Q3" "NLD" "ANN4327C1220" "2011Q4" "NLD" "ANN4327C1220" "2012Q1" "NLD" "ANN4327C1220" "2012Q2" "NLD" "ANN4327C1220" "2012Q3" "NLD" "ANN4327C1220" "2012Q4" "NLD" "ANN4327C1220" "2013Q1" "NLD" "ANN4327C1220" "2013Q2" "NLD" "ANN4327C1220" "2013Q3" "NLD" "ANN4327C1220" "2013Q4" "NLD" "ANN4327C1220" "2014Q1" "NLD" "ANN4327C1220" "2014Q2" "NLD" "ANN4327C1220" "2014Q3" "NLD" "ANN4327C1220" "2014Q4" "NLD" "ANN4327C1220" "2015Q1" "NLD" "ANN4327C1220" "2015Q2" "NLD" "ANN4327C1220" "2015Q3" "NLD" "ANN4327C1220" "2015Q4" "AUT" "AT000000STR1" "2005Q4" "AUT" "AT000000STR1" "2006Q1" "AUT" "AT000000STR1" "2006Q2" "AUT" "AT000000STR1" "2006Q3" "AUT" "AT000000STR1" "2006Q4" "AUT" "AT000000STR1" "2007Q1" "AUT" "AT000000STR1" "2007Q2" "AUT" "AT000000STR1" "2007Q3" "AUT" "AT000000STR1" "2007Q4" "AUT" "AT000000STR1" "2008Q1" "AUT" "AT000000STR1" "2008Q2" "AUT" "AT000000STR1" "2008Q3" end
Where country is the variable "loc", firms are identifies by "ISIN" over quarters ("datacqtr")
I tried with collapse function
Code:
collapse (unique) firms= isin (count) observations = isin , by(loc)
More than happy to receive your help!
Comment