Hi, i'm working with Panel Data. I'm having a problem to unify an ID, named idgrupo, that basically is a variable that agroup every firm that are part of the same business group (0 for those that on a certain moment of time doesn't belong to any). The problem is that when i made the database, in different moment of time the groupid is out of phase for the same firm. For example, Aguas Araucanias that is in the same group with Aguas del Altiplano on 2018yq groupid 86, on 2019q1 they are on groupid 85. I need to unify this, to obtain that Aguas Araucanias is always on groupid 86.
Thank you very much.
Thank you very much.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float newid str50 nombre float yq int idgrupo 1 "Aguas Araucania S.A." 235 86 1 "Aguas Araucania S.A." 236 85 1 "Aguas Araucania S.A." 237 85 1 "Aguas Araucania S.A." 239 84 2 "Sociedad Concesionaria Autopista Central S.A." 200 0 2 "Sociedad Concesionaria Autopista Central S.A." 201 0 2 "Sociedad Concesionaria Autopista Central S.A." 202 0 2 "Sociedad Concesionaria Autopista Central S.A." 203 0 2 "Sociedad Concesionaria Autopista Central S.A." 204 0 2 "Sociedad Concesionaria Autopista Central S.A." 206 0 2 "Sociedad Concesionaria Autopista Central S.A." 207 0 2 "Sociedad Concesionaria Autopista Central S.A." 208 0 2 "Sociedad Concesionaria Autopista Central S.A." 209 0 2 "Sociedad Concesionaria Autopista Central S.A." 210 0 2 "Sociedad Concesionaria Autopista Central S.A." 211 0 2 "Sociedad Concesionaria Autopista Central S.A." 212 0 2 "Sociedad Concesionaria Autopista Central S.A." 213 0 2 "Sociedad Concesionaria Autopista Central S.A." 214 0 2 "Sociedad Concesionaria Autopista Central S.A." 215 0 2 "Sociedad Concesionaria Autopista Central S.A." 216 0 2 "Sociedad Concesionaria Autopista Central S.A." 217 0 2 "Sociedad Concesionaria Autopista Central S.A." 218 0 2 "Sociedad Concesionaria Autopista Central S.A." 219 0 2 "Sociedad Concesionaria Autopista Central S.A." 220 0 2 "Sociedad Concesionaria Autopista Central S.A." 221 0 2 "Sociedad Concesionaria Autopista Central S.A." 222 0 2 "Sociedad Concesionaria Autopista Central S.A." 223 0 2 "Sociedad Concesionaria Autopista Central S.A." 224 0 2 "Sociedad Concesionaria Autopista Central S.A." 225 0 2 "Sociedad Concesionaria Autopista Central S.A." 226 0 2 "Sociedad Concesionaria Autopista Central S.A." 227 0 2 "Sociedad Concesionaria Autopista Central S.A." 228 0 2 "Sociedad Concesionaria Autopista Central S.A." 229 0 2 "Sociedad Concesionaria Autopista Central S.A." 230 0 2 "Sociedad Concesionaria Autopista Central S.A." 231 0 2 "Sociedad Concesionaria Autopista Central S.A." 232 0 2 "Sociedad Concesionaria Autopista Central S.A." 234 0 2 "Sociedad Concesionaria Autopista Central S.A." 238 0 3 "Aguas Del Altiplano S.A." 235 86 3 "Aguas Del Altiplano S.A." 236 85 3 "Aguas Del Altiplano S.A." 237 85 3 "Aguas Del Altiplano S.A." 238 84 3 "Aguas Del Altiplano S.A." 239 84 4 "Ad Retail S.A." 208 0 4 "Ad Retail S.A." 209 0 4 "Ad Retail S.A." 210 0 4 "Ad Retail S.A." 211 0 4 "Ad Retail S.A." 212 0 4 "Ad Retail S.A." 213 0 4 "Ad Retail S.A." 214 0 4 "Ad Retail S.A." 215 0 4 "Ad Retail S.A." 216 0 4 "Ad Retail S.A." 217 0 4 "Ad Retail S.A." 218 0 4 "Ad Retail S.A." 219 0 4 "Ad Retail S.A." 220 122 4 "Ad Retail S.A." 221 119 4 "Ad Retail S.A." 222 121 4 "Ad Retail S.A." 223 117 4 "Ad Retail S.A." 224 119 4 "Ad Retail S.A." 225 114 4 "Ad Retail S.A." 226 113 4 "Ad Retail S.A." 227 110 4 "Ad Retail S.A." 228 110 4 "Ad Retail S.A." 229 110 4 "Ad Retail S.A." 230 109 4 "Ad Retail S.A." 231 109 4 "Ad Retail S.A." 232 109 4 "Ad Retail S.A." 233 108 4 "Ad Retail S.A." 234 103 4 "Ad Retail S.A." 236 102 4 "Ad Retail S.A." 238 101 4 "Ad Retail S.A." 239 101 5 "Autofin S.A." 239 0 6 "Agrosuper S.A." 208 0 6 "Agrosuper S.A." 209 0 6 "Agrosuper S.A." 210 0 6 "Agrosuper S.A." 211 0 6 "Agrosuper S.A." 212 0 6 "Agrosuper S.A." 213 0 6 "Agrosuper S.A." 214 0 6 "Agrosuper S.A." 215 0 6 "Agrosuper S.A." 216 0 6 "Agrosuper S.A." 217 0 6 "Agrosuper S.A." 218 0 6 "Agrosuper S.A." 219 0 6 "Agrosuper S.A." 220 0 6 "Agrosuper S.A." 221 0 6 "Agrosuper S.A." 222 0 6 "Agrosuper S.A." 223 0 6 "Agrosuper S.A." 224 0 6 "Agrosuper S.A." 225 0 6 "Agrosuper S.A." 226 0 6 "Agrosuper S.A." 227 0 6 "Agrosuper S.A." 228 0 6 "Agrosuper S.A." 229 0 6 "Agrosuper S.A." 230 0 6 "Agrosuper S.A." 231 0 6 "Agrosuper S.A." 232 0 6 "Agrosuper S.A." 234 0 end format %tq yq
Comment