Hello, I am very new in R so I am so sorry for this question. I have the Barro-Lee data set which contains 98 countries and I want to run the regressions only for the Latin America countries, so what do you recomend? How can I delete all the other countries or how can I select the countries of Lat. Am. thank you this is the list of countries SHCODE COUNTRY NAME WBCTRY (1) (2) _________________________________________________________________ 1 Algeria DZA + + 2 Angola AGO - - 3 Benin BEN - + 4 Botswana BWA + + 5 Burkina Faso HVO - - 6 Burundi BDI + - 7 Cameroon CMR + + 8 Cape verde CPV - - 9 Central African Rep. CAF + + 10 Chad TCD - - 11 Comoros COM - - 12 Congo COG - + 13 Egypt EGY + + 14 Ethiopia ETH + - 15 Gabon GAB + - 16 Gambia GMB - + 17 Ghana GHA + + 18 Guinea GIN - - 19 Guinea-Bissau GNB - - 20 Cote d'Ivoire CIV + - 21 Kenya KEN + + 22 Lesotho LSO - + 23 Liberia LBR + + 24 Madagascar MDG + - 25 Malawi MWI + + 26 Mali MLI - + 27 Mauritania MRT - - 28 Mauritius MUS + + 29 Morocco MAR + - 30 Mozambique MOZ - - 31 Niger NER - + 32 Nigeria NGA + - 33 Rwanda RWA + + 34 Senegal SEN + + 35 Seychelles SYC - - 36 Sierra Leone SLE + + 37 Somalia SOM - - 38 South africa ZAF + + 39 Sudan SDN + + 40 Swaziland SWZ + + 41 Tanzania TZA + + 42 Togo TGO + + 43 Tunisia TUN + + 44 Uganda UGA + + 45 Zaire ZAR + + 46 Zambia ZMB + + 47 Zimbabwe ZWE + + 48 Bahamas, The BHS - - 49 Barbados BRB + + 50 Canada CAN + + 51 Costa Rica CRI + + 52 Dominica DMA - - 53 Dominican Rep. DOM + + 54 El Salvador SLV + + 55 Grenada GRD - - 56 Guatemala GTM + + 57 Haiti HTI + + 58 Honduras HND + + 59 Jamaica JAM + + 60 Mexico MEX + + 61 Nicaragua NIC + + 62 Panama PAN + + 63 St.Lucia LCA - - 64 St.Vincent & Grens. VCT - - 65 Trinidad & Tobago TTO + + 66 United States USA + + 67 Argentina ARG + + 68 Bolivia BOL + + 69 Brazil BRA + + 70 Chile CHL + + 71 Colombia COL + + 72 Ecuador ECU + + 73 Guyana GUY + + 74 Paraguay PRY + + 75 Peru PER + + 76 Suriname SUR - - 77 Uruguay URY + + 78 Venezuela VEN + + 79 Afghanistan AFG - - 80 Bahrain BHR - - 81 Bangladesh BGD + + 82 Myanmar (Burma) BUR + - 83 China CHN - - 84 Hong Kong HKG + + 85 India IND + + 86 Indonesia IDN + + 87 Iran, I.R. of IRN - + 88 Iraq IRQ + + 89 Israel ISR + + 90 Japan JPN + + 91 Jordan JOR + + 92 Korea KOR + + 93 Kuwait KWT - - 94 Malaysia MYS + + 95 Nepal NPL + + 96 Oman OMN - - 97 Pakistan PAK + + 98 Philippines PHL + + 99 Saudi Arabia SAU - - 100 Singapore SGP + + 101 Sri Lanka LKA + + 102 Syria SYR - + 103 Taiwan OAN + + 104 Thailand THA + + 105 United Arab Emirates ARE - - 106 Yemen, N.Arab YEM - + 107 Austria AUT + + 108 Belgium BEL + + 109 Cyprus CYP + + 110 Denmark DNK + + 111 Finland FIN + + 112 France FRA + + 113 Germany, West DEU + + 114 Greece GRC + + 115 Hungary HUN - - 116 Iceland ISL + - 117 Ireland IRL + + 118 Italy ITA + + 119 Luxembourg LUX + - 120 Malta MLT + + 121 Netherlands NLD + + 122 Norway NOR + + 123 Poland POL - - 124 Portugal PRT + + 125 Spain ESP + + 126 Sweden SWE + + 127 Switzerland CHE + + 128 Turkey TUR + + 129 United Kingdom GBR + + 130 Yugoslavia YUG - + 131 Australia AUS + + 132 Fiji FJI + - 133 New Zealand NZL + + 134 Papua New Guinea PNG + + 135 Solomon Islands SLB - - 136 Tonga TON - - 137 Vanuatu VUT - - 138 Western Samoa WSM - - --------------------------------- Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, Probalo ya! [[alternative HTML version deleted]]
On Tue, Jul 18, 2006 at 12:25:47PM -0300, raul sanchez wrote:> I have the Barro-Lee data set which contains 98 countries and I want > to run the regressions only for the Latin America countries, so what > do you recomend? How can I delete all the other countries or how can > I select the countries of Lat. Am. thank you> this is the list of countries > SHCODE COUNTRY NAME WBCTRY (1) (2) > _________________________________________________________________ > > 1 Algeria DZA + + > 2 Angola AGO - - > 3 Benin BEN - + > 4 Botswana BWA + + > 5 Burkina Faso HVO - - > 6 Burundi BDI + - > 7 Cameroon CMR + +[...] Assuming the data is stored in a data frame called bl you could do something like this: First you generate a list of all countries you are interested in - e.g.> set = c('Benin', 'Congo', 'Mali')And then you subset the data frame with it> bl[bl$COUNTRY %in% set, ]SHCODE COUNTRY NAME WBCTRY X.1. X.2. 3 3 Benin BEN - + NA 12 12 Congo COG - + NA 26 26 Mali MLI - + NA cu Philipp -- Dr. Philipp Pagel Tel. +49-8161-71 2131 Dept. of Genome Oriented Bioinformatics Fax. +49-8161-71 2186 Technical University of Munich Science Center Weihenstephan 85350 Freising, Germany and Institute for Bioinformatics / MIPS Tel. +49-89-3187 3675 GSF - National Research Center Fax. +49-89-3187 3585 for Environment and Health Ingolst?dter Landstrasse 1 85764 Neuherberg, Germany http://mips.gsf.de/staff/pagel
Il giorno mar, 18/07/2006 alle 12.25 -0300, raul sanchez ha scritto:> how can I select the countries of Lat. Am. thank youhint: add to the data.frame a column with the continental ID so this could be usefull for other needs. hint: ?subset -- Daniele Medri