I am looking for help with expanding my dataset below to include a categorical variable that takes the values 1 to 15 for each observation. How can i do it. So i need to have 15 observations of each of the individual observations currently in the dataset.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str5 nuts318cd str9 ttwa11cd double area_intersection_sqm float(percentage_nuts3_in_ttwa percentage_ttwa_in_nuts3) "UKC11" "E30000093" 203769975.4 68.5304 26.73737 "UKC11" "E30000199" 31866.05631 .010716955 .00800233 "UKC11" "E30000203" 8120.006566 .00273086 .00047345 "UKC11" "E30000215" 93514618.39 31.45014 92.84214 "UKC11" "E30000246" 16150.06451 .005431469 .000754046 "UKC11" "E30000275" 1721.391752 .000578926 .000566958 "UKC12" "E30000093" 298643393.4 99.99471 39.18604 "UKC12" "E30000147" 15797.86158 .005289595 .003358221 "UKC13" "E30000093" 40310.33369 .020412154 .005289259 "UKC13" "E30000199" 197413336.2 99.96523 49.57521 "UKC13" "E30000203" 14324.15059 .007253395 .000835193 "UKC13" "E30000246" 14039.81523 .007109415 .000655519 "UKC14" "E30000064" 22453.95394 .001006206 .001029967 "UKC14" "E30000093" 434.9438238 .0000194907 .0000570705 "UKC14" "E30000106" 56045.84077 .002511524 .002862576 "UKC14" "E30000199" 47431345.3 2.1254914 11.911146 "UKC14" "E30000203" 1714908898 76.84842 99.99057 "UKC14" "E30000215" 7209707.493 .3230811 7.157861 "UKC14" "E30000245" 318562308.6 14.2754 25.26244 "UKC14" "E30000246" 9913.175135 .000444229 .000462846 "UKC14" "E30000275" 143346252.4 6.423626 47.21256 "UKC21" "E30000064" 2030476941 40.40051 93.13832 "UKC21" "E30000106" 12.28169309 2.44369e-07 6.27295e-07 "UKC21" "E30000173" 1460636223 29.062355 99.99895 "UKC21" "E30000203" 10266.28956 .000204269 .000598593 "UKC21" "E30000245" 563125216.8 11.204532 44.65662 "UKC21" "K01000009" 971549507.2 19.33097 57.50991 "UKC21" "K01000010" 51041.11077 .001015568 .002415779 "UKC21" "S22000067" 20922.50236 .000416296 .001403097 "UKC22" "E30000173" 1066.288223 .000265062 .0000730009 "UKC22" "E30000245" 379294671.4 94.28657 30.0786 "UKC22" "E30000275" 22982843.17 5.713166 7.569636 "UKC23" "E30000203" 5531.766495 .004028287 .000322539 "UKC23" "E30000245" 29468.49058 .021459244 .002336893 "UKC23" "E30000275" 137288062 99.97451 45.21724 "UKD11" "E30000106" 15318.28089 .000738895 .000782391 "UKD11" "E30000163" 77898272.46 3.757515 14.123253 "UKD11" "E30000223" 7257.39641 .000350069 .000672506 "UKD11" "E30000286" 737526859.2 35.575474 99.99664 "UKD11" "E30000290" 851034545.5 41.05065 99.99887 "UKD11" "K01000010" 406650680.9 19.61527 19.246805 "UKD12" "E30000039" 392.9681989 8.27563e-06 .0000333336 "UKD12" "E30000064" 149557684.9 3.149577 6.860236 "UKD12" "E30000076" 22084.66337 .000465087 .003840515 "UKD12" "E30000106" 1957803573 41.22993 99.99604 "UKD12" "E30000163" 473662135.9 9.974983 85.87675 "UKD12" "E30000203" 82740.55843 .001742456 .004824324 "UKD12" "E30000223" 1079124408 22.72558 99.99703 "UKD12" "E30000246" 20307.96607 .000427671 .000948179 "UKD12" "E30000286" 24754.72675 .000521317 .003356338 "UKD12" "E30000290" 9621.292648 .000202617 .001130528 "UKD12" "K01000010" 1088165321 22.91598 51.50294 "UKD12" "S22000067" 27691.31014 .000583159 .001857024 "UKD33" "E30000239" 115595841.7 100 6.289208 "UKD34" "E30000239" 203167544.3 99.99309 11.05371 "UKD34" "E30000284" 14042.44305 .006911277 .001959212 "UKD35" "E30000239" 229213855.8 100 12.47081 "UKD36" "E30000170" 8056.388494 .002456537 .00111413 "UKD36" "E30000239" 172919193 52.72615 9.407992 "UKD36" "E30000255" 24226.78715 .007387181 .002584866 "UKD36" "E30000284" 155005669.1 47.264 21.62651 "UKD37" "E30000029" 7006.580527 .001751785 .001925189 "UKD37" "E30000170" 11991.00274 .00299799 .001658254 "UKD37" "E30000219" 20101.86674 .005025868 .005382483 "UKD37" "E30000239" 399928974.5 99.99023 21.758884 "UKD41" "E30000170" 107194506.6 78.21149 14.824088 "UKD41" "E30000239" 29849325 21.77873 1.6240083 "UKD41" "E30000255" 13401.89378 .00977832 .001429909 "UKD42" "E30000171" 34872029.36 100 16.13467 "UKD44" "E30000039" 12103.43673 .001412412 .001026678 "UKD44" "E30000076" 574996921.4 67.09933 99.99177 "UKD44" "E30000170" 183.1079797 .0000213678 .0000253223 "UKD44" "E30000171" 64195469.6 7.491297 29.70211 "UKD44" "E30000223" 16445.66858 .001919129 .001523937 "UKD44" "E30000255" 217712862.6 25.406025 23.228775 "UKD45" "E30000039" 7479.785688 .000744056 .000634475 "UKD45" "E30000076" 13721.62053 .001364966 .002386185 "UKD45" "E30000170" 422956930.5 42.07388 58.49134 "UKD45" "E30000171" 117063523.2 11.64496 54.16322 "UKD45" "E30000182" 19037.76823 .001893793 .006798087 "UKD45" "E30000255" 465211381.6 46.27716 49.63552 "UKD46" "E30000018" 346.9086397 .0000706419 .000100878 "UKD46" "E30000029" 14486.7692 .002949978 .00398051 "UKD46" "E30000039" 9279.847951 .001889679 .000787166 "UKD46" "E30000170" 192902964.5 39.28132 26.67684 "UKD46" "E30000182" 280009612.2 57.01907 99.98702 "UKD46" "E30000239" 18143955.22 3.6947 .9871558 "UKD47" "E30000170" 17756.33516 .003231584 .00245555 "UKD47" "E30000233" 248511241.2 45.22808 40.97392 "UKD47" "E30000239" 18148.76411 .003303004 .000987417 "UKD47" "E30000255" 254286723.4 46.27919 27.131006 "UKD47" "E30000284" 46628424.33 8.486192 6.505633 "UKD61" "E30000239" 38439.87147 .02128579 .002091393 "UKD61" "E30000284" 180550930.7 99.97871 25.190605 "UKD62" "E30000185" 841.4333672 .0000721424 .000189205 "UKD62" "E30000197" 662756971.6 56.82312 78.0034 "UKD62" "E30000239" 475823055.3 40.79588 25.88804 "UKD62" "E30000262" 13702.54716 .001174822 .001188375 "UKD62" "E30000273" 27661249.03 2.371606 2.5870845 "UKD62" "E30000284" 19827.24759 .001699938 .002766313 end
Best,
Bridget
0 Response to Expand data
Post a Comment