I have the following (maybe silly) problem, which I cannot solve.
I have the following data:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str3 iso_o str52 country_o str3 iso_d str52 country_d byte col float(csl cnl prox1 lp1 prox2 lp2 cl cle) str32 NAMES_STD "BLX" "Belgium and Luxembourg" "AFG" "Afghanistan" 0 .000273 .000273 .25 1.9458665 .10716087 .9601701 .12580793 .12667672 "Belgium" "BLX" "Belgium and Luxembourg" "ALB" "Albania" 0 0 0 .25 1.9458665 .1070556 .9592268 .12544584 .12631404 "Belgium" "BLX" "Belgium and Luxembourg" "DZA" "Algeria" 1 .4988294 .005642 0 0 .0707655 .6340647 .21813615 .212725 "Belgium" "BLX" "Belgium and Luxembourg" "AND" "Andorra" 1 .6889079 .1747249 .2328 1.811991 .10901195 .9767559 .388072 .38383695 "Belgium" "BLX" "Belgium and Luxembourg" "AGO" "Angola" 0 .00648 .00486 .3575 2.782589 .18500473 1.6576574 .2205917 .22208473 "Belgium" "BLX" "Belgium and Luxembourg" "AIA" "Anguilla" 0 .54362804 .000828 .3925 3.05501 .26269874 2.3538022 .3083989 .3105275 "Belgium" "BLX" "Belgium and Luxembourg" "ATG" "Antigua and Barbuda" 0 .47272 .000702 .3925 3.05501 .26269874 2.3538022 .3083116 .3104406 "Belgium" "BLX" "Belgium and Luxembourg" "ARG" "Argentina" 0 .070164636 .009493327 .3575 2.782589 .17853823 1.599717 .2167152 .21814933 "Belgium" "BLX" "Belgium and Luxembourg" "ARM" "Armenia" 0 .000455 .000455 .25 1.9458665 .07627013 .6833866 .08978632 .09040457 "Belgium" "BLX" "Belgium and Luxembourg" "ABW" "Aruba" 1 .3139827 .036364388 .465 3.619311 .17659363 1.5822933 .3617912 .3573743 "Belgium" "BLX" "Belgium and Luxembourg" "AUS" "Australia" 0 .57412785 .0011027019 .3925 3.05501 .26269874 2.3538022 .308589 .3107171 "Belgium" "BLX" "Belgium and Luxembourg" "AUT" "Austria" 1 .6199744 .003456 .535 4.1641545 .3099715 2.77737 .495746 .4922561 "Belgium" "BLX" "Belgium and Luxembourg" "AZE" "Azerbaijan" 0 .008918 .006916 0 0 .08643995 .774509 .1075043 .10820045 "Belgium" "BLX" "Belgium and Luxembourg" "BHS" "Bahamas" 0 .514083 .000711 .3925 3.05501 .26269874 2.3538022 .3083179 .3104468 "Belgium" "BLX" "Belgium and Luxembourg" "BHR" "Bahrain" 0 .007917 .005005 0 0 .0707655 .6340647 .08751174 .08808276 "Belgium" "BLX" "Belgium and Luxembourg" "BGD" "Bangladesh" 0 .011818 0 .25 1.9458665 .12923352 1.1579429 .15143356 .1524816 "Belgium" "BLX" "Belgium and Luxembourg" "BRB" "Barbados" 0 .58502465 .0009269314 .3925 3.05501 .26269874 2.3538022 .3084673 .3105958 "Belgium" "BLX" "Belgium and Luxembourg" "BLR" "Belarus" 0 .000364 .000364 .25 1.9458665 .1200436 1.0756004 .14097776 .14195092 "Belgium" "BLX" "Belgium and Luxembourg" "BLZ" "Belize" 0 .497039 .0038411426 .3799 2.956939 .23240095 2.0823314 .2751184 .2769959 "Belgium" "BLX" "Belgium and Luxembourg" "BEN" "Benin" 1 .22594 0 0 0 0 0 .13077809 .12476233 "Belgium" "LUX" "Luxemburg" "" "" . . . . . . . . . "" "LUX" "Luxemburg" "" "" . . . . . . . . . "" "LUX" "Luxemburg" "" "" . . . . . . . . . "" "LUX" "Luxemburg" "" "" . . . . . . . . . "" "LUX" "Luxemburg" "" "" . . . . . . . . . "" "LUX" "Luxemburg" "" "" . . . . . . . . . "" "LUX" "Luxemburg" "" "" . . . . . . . . . "" "LUX" "Luxemburg" "" "" . . . . . . . . . "" "LUX" "Luxemburg" "" "" . . . . . . . . . "" "LUX" "Luxemburg" "" "" . . . . . . . . . "" "LUX" "Luxemburg" "" "" . . . . . . . . . "" "LUX" "Luxemburg" "" "" . . . . . . . . . "" "LUX" "Luxemburg" "" "" . . . . . . . . . "" "LUX" "Luxemburg" "" "" . . . . . . . . . "" "LUX" "Luxemburg" "" "" . . . . . . . . . "" "LUX" "Luxemburg" "" "" . . . . . . . . . "" "LUX" "Luxemburg" "" "" . . . . . . . . . "" "LUX" "Luxemburg" "" "" . . . . . . . . . "" "LUX" "Luxemburg" "" "" . . . . . . . . . "" "LUX" "Luxemburg" "" "" . . . . . . . . . "" "LUX" "Luxemburg" "" "" . . . . . . . . . "" end
I would like to replace the missing values for Luxembourg with the same data that I have for Belgium & Luxemburg. I tried to do it one by one using for instance:
Code:
replace iso_d=iso_d in 21/40 if NAMES_STD=="Belgium"
Thanks in advace
0 Response to Replacing missing values
Post a Comment