I have a file with more than 1k observations and two variables. One of the variables Y is complete but the variable Countryis not and it looks like this (I want to replace rows 2 to 19 with row 1,ie America and rows 20 to 39 with row 2 i.e. Germany:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float n str40 country 1 " America" 2 "" 3 "" 4 "" 5 "" 6 "" 7 "" 8 "" 9 "" 10 "" 11 "" 12 "" 13 "" 14 "" 15 "" 16 "" 17 "" 18 "" 19 "" 20 "" Germany" 21 "" 22 "" 23 "" 24 "" 25 "" 26 "" 27 "" 28 "" 29 "" 30 "" 31 "" 32 "" 33 "" 34 "" 35 "" 36 "" 37 "" 38 "" 39 "" 40 "" Belgium" 41 "" 42 "" 43 "" 44 "" 45 "" 46 "" 47 "" 48 "" 49 "" 50 "" 51 "" 52 "" 53 "" 54 "" 55 "" 56 "" 57 "" 58 "" 59 "" 60 "" Somalia" 61 "" 62 " 63 "" 64 "" 65 "" 66 "" 67 "" 68 "" 69 "" 70 "" 71 "" 72 "" 73 "" 74 "" 75 "" 76 "" 77 "" 78 "" 79 "" 80 "" Spain" 81 "" 82 "" 83 "" 84 "" 85 "" 86 "" 87 "" 88 "" 89 "" 90 "" 91 "" 92 "" 93 "" 94 "" 95 "" 96 "" 97 "" 98 "" 99 "" 100 "" end
Thanks,
Dapel
0 Response to Replacing missing rows of a variable
Post a Comment