I am working with panel data. The first dimension is year, second dimension in country. I have grouped these two to define a market. Now, within each market there are many car models and the code variable is artificially generated code for each car model and model variable is string variable for car name. The problem is that in each market i.e. (country , year group) not all car brands are sold. Secondly, the data is not arranged in terms of car models. I am trying to do the following two things.
1- Creating rows in each market for remaining models that are not sold. In total I have 356 models that are sold anytime during the studied period. I want to create these rows as "." or missing value.
2- I want to rearrange the rows in such a way, that for each market model no 1 appears in first row, and 2 in second row, and so on. I also want to save that in excel in the same format.
Any help is much appreciated.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(mkt code) str11 model 1 236 "33" 1 262 "olympia" 1 230 "2002" 1 48 "escort" 1 185 "corolla" 1 228 "1502" 1 43 "128" 1 224 "60-75" 1 240 "125" 1 268 "viva" 1 274 "1100" 1 254 "primula" 1 234 "d-ds 20" 1 252 "fulvia" 1 275 "1300" 1 131 "4" 1 290 "bagheera" 1 148 "mini" 1 116 "commodor" 1 128 "304" 1 229 "1800" 1 250 "2000" 1 225 "prinz1000" 1 222 "1200" 1 259 "1000" 1 219 "1750" 1 270 "404" 1 145 "12" 1 88 "200" 1 288 "1301" 1 15 "2CV6" 1 109 "kadet" 1 144 "6" 1 269 "204" 1 227 "ro 80" 1 285 "1000" 1 238 "124" 1 233 "ami" 1 23 "dyane" 1 169 "99" 1 242 "500/600" 1 221 "giulia" 1 249 "N600" 1 239 "124 S" 1 231 "2500" 1 294 "chamois" 1 261 "admiral" 1 278 "3500" 1 53 "taunus" 1 299 "140" end label values code code label def code 15 "26", modify label def code 23 "36", modify label def code 43 "64", modify label def code 48 "71", modify label def code 53 "77", modify label def code 88 "134", modify label def code 109 "165", modify label def code 116 "174", modify label def code 128 "187", modify label def code 131 "196", modify label def code 144 "213", modify label def code 145 "214", modify label def code 148 "217", modify label def code 169 "241", modify label def code 185 "269", modify label def code 219 "400", modify label def code 221 "402", modify label def code 222 "404", modify label def code 224 "406", modify label def code 225 "407", modify label def code 227 "409", modify label def code 228 "410", modify label def code 229 "411", modify label def code 230 "412", modify label def code 231 "413", modify label def code 233 "417", modify label def code 234 "418", modify label def code 236 "422", modify label def code 238 "429", modify label def code 239 "430", modify label def code 240 "431", modify label def code 242 "434", modify label def code 249 "447", modify label def code 250 "452", modify label def code 252 "455", modify label def code 254 "458", modify label def code 259 "468", modify label def code 261 "478", modify label def code 262 "481", modify label def code 268 "488", modify label def code 269 "490", modify label def code 270 "491", modify label def code 274 "499", modify label def code 275 "500", modify label def code 278 "503", modify label def code 285 "521", modify label def code 288 "524", modify label def code 290 "526", modify label def code 294 "530", modify label def code 299 "541", modify
0 Response to Complete the missing data in Panel data
Post a Comment