14 Fixed Effects

This file demonstrates three approaches to estimating “fixed effects” models (remember this is what economists call “fixed effects”, but other disciplines use “fixed effects” to refer to something different). We’re going to use the wbstats package to download country-level data from the World Bank for 2020 - 2023 (the most recently available for the variables I chose–life expectancy isn’t available for 2024 yet). We’ll then estimate models with country fixed effects, with year fixed effects, and with both country and year fixed effects. We’ll estimate each model three ways: using the within transformation, using dummy variables, and using the plm package to apply the within transformation for us. If you don’t know what these are, go through LN5 first.

To be clear, this is the only time you’ll estimate fixed effects models 3 ways. You’re doing it 3 ways so you can see that each model produces identical coefficients (but different SEs and thus p-values, CIs, and t-stats). Once you see that the three methods do indeed produce identical coefficients, you should just use the plm package. For the PP, you should use the plm package for county and state-year fixed effects, and factor(year) for year fixed effects (so county and year fixed effects would use plm for the county fixed effects and include factor(year) as a variable).

Note that the model we’ll estimate isn’t a great model in terms of producing interesting, reliable result. This is by design. Part of this chapter is introducing you to another API you can use to get data. You’ve worked with the US Census Bureau’s API to get data on US counties. Now from this chapter you will have experience getting data on countries from the World Bank. You are free to use either source for data for your RP. If the model here was a great one, it might take away something you want to do for your RP. This way you get experience with fixed effects models and with getting data from the World Bank, but don’t waste any potential ideas you might have for your RP. So just don’t read too much into the results. They likely suffer from reverse causation and omitted variable bias (both violations of ZCM). If you’re interested in cross-country variation in life expectancy you’ll need to dig much deeper than we’ll go in this chapter.

So what do you have to do? First, go through the details of the models with country fixed effects. I already did it for you, but you should go through it (together with going through LN5) to make sure you understand. After you feel you understand country fixed effects, try to estimate the models with Year Fixed Effects yourself. Once you’ve figured that out, try to estimate the models with both Country and Year Fixed Effects yourself. Just look for the code chunk comments that say “YOUR CODE GOES HERE”. That’s where you need to write code (mostly copy/pasting from what comes before it, making changes as appropriate).

Note that I have you the code for the stargazer tables, but until you estimate all the models it will display an error. For example, until you estimate yearDummies, you’ll get an error message: “object ‘yearDummies’ not found”. When you’re done all the error messages should be gone.

library(wbstats) # To get data from the World Bank API
library(plm) # To estimate fixed effects models
library(formattable) # to make colorful tables similar to Excel's conditional formatting
library(stargazer)
library(tidyverse)

## Set how many decimals at which R starts to use scientific notation 
options(scipen=3)
## This shows you a lot of what's available from the World Bank API
# listWBinfo <- wb_cachelist

## List of countries in the World Bank data
countryList <- wb_countries()

## List of all available variables (what they call "indicators")
availableIndicators <- wb_cachelist$indicators

## Sometimes it's easier to look through the indicator list if you write it to CSV and open it in Excel (you can do the same thing with the US Census data). The following does that: 
# write.csv(select(availableIndicators,indicator_id, indicator, indicator_desc),"indicators.csv")

## NOTE: if you use any of these (the full list of variables, exporting it to CSV), make sure you do NOT leave that in your final code. It doesn't belong in your RMD file. I just put these things in here so you see how to get to this information. 

## We'll use the following variables: 
# SP.DYN.LE00.IN    Life expectancy at birth, total (years)
# NY.GDP.PCAP.KD    GDP per capita (constant 2010 US$)
# SP.POP.TOTL   Population, total
# SP.POP.TOTL.FE.ZS Population, female (% of total population)
# SP.RUR.TOTL.ZS    Rural population (% of total population)


## Create named vector of indicators to download
indicatorsToDownload <- c(
  lifeExp = "SP.DYN.LE00.IN", 
  gdpPerCapita ="NY.GDP.PCAP.KD", 
  pop = "SP.POP.TOTL",
  pctFemale = "SP.POP.TOTL.FE.ZS",
  pctRural = "SP.RUR.TOTL.ZS"
)

## Download descriptions of on World Bank indicators (i.e., variables)
indicatorInfo <- availableIndicators %>% 
                  filter(indicator_id %in% indicatorsToDownload)


## Build description of our variables that we'll output in the HTML body
sDesc <- ""
for(i in 1:nrow(indicatorInfo)){
  sDesc <- paste0(sDesc
                  ,"<b>",
                  indicatorInfo$indicator[i],
                  " (",indicatorInfo$indicator_id[i]
                  , ")</b>: "
                  ,indicatorInfo$indicator_desc[i]
                  ,"<br>")
}
## Download data
mydataOrig <- wb_data(indicatorsToDownload, 
                      start_date = 2020, 
                      end_date = 2023)

## get vector of TRUE and FALSE where FALSE indicates there's one or more NA
noNAs <- complete.cases(mydataOrig)

## When writing this code, I first checked how many rows do have NAs, and then out of how many rows 
# sum(noNAs)
## out of how many rows:
# length(noNAs)

## keep rows without any NA
mydata <- mydataOrig[noNAs,]

## get count of rows for each country
countOfYearsByCountry <-  mydata %>% count(country)

## merge the count variable with the data
mydata <- inner_join(mydata,countOfYearsByCountry, by="country")

## keep only countries that have all 4 years complete
mydata <- mydata %>% filter(n==4)

## drop count variable (since all are now 4)
mydata <- mydata %>% select(-n)


## For the purposes of this chapter, let's only examine one group of countries 
## so that we can output results without it taking up hundreds of lines
## Normally you don't want to get rid of countries like this
## but doing so will make things run much more quickly,
## so for the purposes of the BP we're going to only keep one region

## Merge in country info (e.g., region)
mydata <- inner_join(mydata,select(countryList,country,region),by="country")

## Keep only region "Latin America & Caribbean" (so we end up with only 31 countries, which we need to do so we're only displaying 30 dummy variables instead of a few hundred)
mydata <- mydata %>% filter(region == "Latin America & Caribbean") %>% select(-region)

mydata <- mydata %>% rename(year=date)

## Change scale of variables. This re-scales regression coefficients (instead of getting 0.00000123)
####  Measure population in millions of people instead of people
####  Measure GDP per Capita in thousands of 2010 US $ (instead of 2010 US $)
mydata <- mydata %>% mutate(pop=pop/1000000, 
                            gdpPerCapita=gdpPerCapita/1000)
## Display results of selected variables in stargazer table
## (without converting it to a data frame it doesn't display anything)
mydata %>% select(lifeExp, gdpPerCapita, pop, pctFemale, pctRural) %>% 
  as.data.frame() %>%
  stargazer(., type = "html",summary.stat = c("n","mean","sd", "min", "p25", "median", "p75", "max"))
Statistic N Mean St. Dev. Min Pctl(25) Median Pctl(75) Max
lifeExp 156 73.748 3.970 61.427 71.224 73.688 76.668 81.690
gdpPerCapita 156 14.086 14.296 1.219 6.123 9.042 17.337 83.005
pop 156 16.697 38.720 0.041 0.155 3.394 11.847 211.141
pctFemale 156 50.746 0.992 48.753 49.965 50.516 51.405 52.882
pctRural 156 31.886 21.005 0.000 13.033 29.510 44.479 75.550

14.1 Variables

Variable descriptions from the World Bank API. These descriptions do not reflect two changes we made (that are reflected in the table of summary statistics above and in the regression results that follow): population is measured in millions of people and GDP per capita is measured in thousands of 2010 US dollars.

GDP per capita (constant 2010 US$) (NY.GDP.PCAP.KD): GDP per capita is gross domestic product divided by midyear population. GDP is the sum of gross value added by all resident producers in the economy plus any product taxes and minus any subsidies not included in the value of the products. It is calculated without making deductions for depreciation of fabricated assets or for depletion and degradation of natural resources. Data are in constant 2010 U.S. dollars.
Life expectancy at birth, total (years) (SP.DYN.LE00.IN): Life expectancy at birth indicates the number of years a newborn infant would live if prevailing patterns of mortality at the time of its birth were to stay the same throughout its life.
Population, total (SP.POP.TOTL): Total population is based on the de facto definition of population, which counts all residents regardless of legal status or citizenship. The values shown are midyear estimates.
Population, female (% of total population) (SP.POP.TOTL.FE.ZS): Female population is the percentage of the population that is female. Population is based on the de facto definition of population, which counts all residents regardless of legal status or citizenship.
Rural population (% of total population) (SP.RUR.TOTL.ZS): Rural population refers to people living in rural areas as defined by national statistical offices. It is calculated as the difference between total population and urban population.

Source of data definitions: wbstats package

Note that if you displayed the exact wording of others without quotation marks in a paper, it would be plagiarism (and if you added quotation marks it wouldn’t be plagiarism, but it would make for a bad paper). However, for our purposes here, we’re just printing out a convenient list of definitions so we have it all in one place (i.e., this isn’t a paper).

14.2 OLS

Our focus is fixed effects models, but often when estimating fixed effects models we also estimate regular OLS without fixed effects for comparison.

ols <- lm(data=mydata,lifeExp~gdpPerCapita+pop+pctFemale+pctRural)

14.3 Country Fixed Effects

Our basic OLS model is the following: \[ lifeExp_{it} = \beta_0+\beta_1 gdpPerCapita_{it} + \beta_2 pop_{it} + \beta_3 pctFemale_{it} + \beta_4 pctRural_{it} + v_{it} \] To save on notation, we’ll use generic variables (and I wrote out the “composite error term”), i.e.,

\[ y_{it} = \beta_0+\beta_1 x_{1it} + \beta_2 x_{2it} + \beta_3 x_{2it} + \beta_4 x_{4it} + (c_i + u_{it}) \]

Below there are 3 equations. The first is for country \(i\) in year \(t\) (the same as the one above). The second equation is the average over the four years for country \(i\), where \(\bar{y}_{i}=\sum_{t=2020}^{2023}y_{it}\) is the average value of \(y_{it}\) over the 4 years for country \(i\), \(\bar{x}_{ji}=\sum_{t=2020}^{2023}x_{jti}\) is the average value of \(x_{jti}\) over the 4 years for country \(i\) for the four explanatory variables \(j\in\{1,2,3,4\}\), \(\bar{c}_{i}=\sum_{t=2020}^{2023}c_{i}=c_i\) is the average value of \(c_{i}\) over the 4 years for country \(i\) (which just equals \(c_i\) because \(c_i\) is the same in all years for country \(i\)), and \(\bar{u}_{i}=\sum_{t=2020}^{2023}u_{it}\) is the average value of \(u_{it}\) over the 4 years for country \(i\). For the final equation, subtract country \(i\)’s average from the value in each year \(t\).

\[ \begin{align} y_{it} &= \beta_0+\beta_1 x_{1it} + \beta_2 x_{2it} + \beta_3 x_{2it} + \beta_4 x_{4it} + (c_i + u_{it}) \\ \bar{y}_{i} &= \beta_0+\beta_1 \bar{x}_{1i} + \beta_2 \bar{x}_{2i} + \beta_3 \bar{x}_{3i} + \beta_4 \bar{x}_{4i} + (\bar{c}_i + \bar{u}_{i}) \\ y_{it}-\bar{y}_{i} &= (\beta_0-\beta_0)+\beta_1 (x_{1it}-\bar{x}_{1i}) + \beta_2 (x_{2it}-\bar{x}_{2i}) + \beta_3 (x_{3it}-\bar{x}_{3i}) \\ &\hspace{6cm} + \beta_4 (x_{4it}-\bar{x}_{4i}) + (c_i-\bar{c}_i + u_{it}-\bar{u}_{i}) \end{align} \]

This final equation simplifies to the “within transformation” for country \(i\), \[ y_{it}-\bar{y}_{i} = \beta_1 (x_{1it}-\bar{x}_{1i}) + \beta_2 (x_{2it}-\bar{x}_{2i}) + \beta_3 (x_{3it}-\bar{x}_{3i}) + \beta_4 (x_{4it}-\bar{x}_{4i}) + (u_{it}-\bar{u}_{i}) \] because \(\beta_0-\beta_0=0\) and \(c_i-\bar{c}_i=0\), where \(\bar{c}_i=c_i\) because \(c_i\) is the same in all years for country \(i\). Mathematically, this is why the fixed effects model allows us to control for observable factors that do not change of time (or whatever is measured by \(t=1,,,,.T\)). If \(c_i\) is not constant for all time periods, then \(\bar{c}_i=c_i\) isn’t correct and it doesn’t drop out of the final equation. That means it remains in the equations we estimate, and our coefficients are biased.

At the end of this file there are tables that demonstrate the within transformation for our dataset. There is a table for each variable. Look at the table for Life expectancy. Find the row for Argentina (iso3c code ARG). It’s average value of life expectancy is 75.76. In 2020, their value was 75.88, which is 0.12 below Argentina’s four-year average value of 75.76. In 2020, Argentina’s life expectancy was 75.88, which is 0.12 above Argentina’s four-year average. Below this table for life expectancy is a similar table for each explanatory variable. When economists say a model has country “fixed effects”, they mean estimating an OLS regression using data transformed by this “within” transformation.

Alternatively, a model with country “fixed effects” can be estimated using the original OLS equation with the addition of a dummy variable for each country (omitting one).

\[ y_{it} = \beta_0+\beta_1 x_{1it} + \beta_2 x_{2it} + \beta_3 x_{2it} + \beta_4 x_{4it} + \sum_{i=2}^{50}\sigma_idC_i + (c_i + u_{it}) \]

where \(dC_i\) is a dummy variable with a value of 1 if that observation is country \(i\) and equals 0 otherwise (and \(\sigma_i\) is the coefficient on dummy variable \(dC_i\)).

These two models, the “within transformation” and the model with a dummy variable for each country, are mathematically and empirically equivalent. To see that they are empirically equivalent, we’ll estimate both models and compare the results. Note that the standard errors and \(R^2\) values are not equivalent, as discussed below.

Note that when we create the within-transformed variables, we’re going to store them in a new dataframe mydataCountry so that we can use the same variable names. By keeping the same variable names, when we use the variables in the regression and display the results in stargazer, the coefficients will go on the same rows as the other two models.

## Dummy variable for each country (it automatically omits one)
countryDummies <- lm(lifeExp~gdpPerCapita+pop+pctFemale+pctRural+factor(country),data=mydata)

## Within transformation (subtract country averages from each observation for each variable)

## Create country averages and add them to mydata
mydata <- mydata %>%
  group_by(country) %>%
  mutate(cAvg_lifeExp=mean(lifeExp),
         cAvg_gdpPerCapita=mean(gdpPerCapita),
         cAvg_pop=mean(pop),
         cAvg_pctFemale=mean(pctFemale),
         cAvg_pctRural=mean(pctRural)
         ) %>%
  ungroup()

## Within transformation (stored in its own dataframe so can use the same names)
mydataCountry <- mydata %>%
  mutate(lifeExp=lifeExp-cAvg_lifeExp,
         gdpPerCapita=gdpPerCapita-cAvg_gdpPerCapita,
         pop=pop-cAvg_pop,
         pctFemale=pctFemale-cAvg_pctFemale,
         pctRural=pctRural-cAvg_pctRural
         ) 

## Estimate within transformation using the transformed data (stored in mydataCountry)
countryWithin <- lm(lifeExp~gdpPerCapita+pop+pctFemale+pctRural,data=mydataCountry)

## Using plm package
countryPlm <- plm(lifeExp~gdpPerCapita+pop+pctFemale+pctRural,data=mydata, index=c("country"), model = "within", effect="individual")
stargazer(countryDummies,countryWithin,countryPlm, 
          type = "html", 
          report=('vcs*'),
          single.row = TRUE,
          digits = 4,
          keep.stat = c("n","rsq","adj.rsq"), 
          notes = "Standard Errors reported in parentheses, <em>&#42;p&lt;0.1;&#42;&#42;p&lt;0.05;&#42;&#42;&#42;p&lt;0.01</em>", 
          notes.append = FALSE,
          title = "Country Fixed Effects",
          model.numbers = FALSE, 
          column.labels = c("Dummies", "Within", "PLM"))
Country Fixed Effects
Dependent variable:
lifeExp
OLS panel
linear
Dummies Within PLM
gdpPerCapita 0.1353 (0.0641)** 0.1353 (0.0554)** 0.1353 (0.0641)**
pop 1.8337 (0.4548)*** 1.8337 (0.3934)*** 1.8337 (0.4548)***
pctFemale 4.4789 (3.3065) 4.4789 (2.8604) 4.4789 (3.3065)
pctRural -0.3517 (0.3265) -0.3517 (0.2825) -0.3517 (0.3265)
factor(country)Argentina -98.6624 (29.7695)***
factor(country)Aruba -18.2747 (11.8179)
factor(country)Bahamas, The -25.1104 (18.9877)
factor(country)Barbados -12.2632 (11.9313)
factor(country)Belize 1.9467 (12.5577)
factor(country)Bolivia -36.8000 (19.8985)*
factor(country)Brazil -401.0207 (94.0531)***
factor(country)Cayman Islands -20.5800 (29.5963)
factor(country)Chile -45.8637 (24.5629)*
factor(country)Colombia -105.5008 (28.3611)***
factor(country)Costa Rica -17.0403 (20.4017)
factor(country)Cuba -29.9397 (20.0256)
factor(country)Curacao -24.5835 (21.8246)
factor(country)Dominica -10.7209 (20.3407)
factor(country)Dominican Republic -30.6370 (19.5146)
factor(country)Ecuador -36.7972 (17.9034)**
factor(country)El Salvador -33.5624 (15.6726)**
factor(country)Grenada 6.4837 (10.8672)
factor(country)Guatemala -39.2437 (15.3118)**
factor(country)Guyana -5.8042 (4.3332)
factor(country)Haiti -33.6105 (13.7727)**
factor(country)Honduras -21.9109 (16.8228)
factor(country)Jamaica -13.1020 (14.3561)
factor(country)Mexico -253.8406 (57.5905)***
factor(country)Nicaragua -19.7683 (13.9517)
factor(country)Panama -10.4352 (18.0213)
factor(country)Paraguay -19.8828 (18.9663)
factor(country)Peru -73.0598 (25.5459)***
factor(country)Puerto Rico (US) -30.7786 (21.9505)
factor(country)Sint Maarten (Dutch part) -25.0513 (26.3739)
factor(country)St. Kitts and Nevis -7.3630 (3.4258)**
factor(country)St. Lucia 2.5417 (6.8389)
factor(country)St. Vincent and the Grenadines 1.7795 (15.9968)
factor(country)Suriname -8.4244 (18.1640)
factor(country)Trinidad and Tobago -8.8735 (13.1916)
factor(country)Turks and Caicos Islands -16.3338 (26.9819)
factor(country)Uruguay -27.2298 (24.2091)
factor(country)Venezuela, RB -68.9979 (25.2787)***
Constant -133.3557 (183.5840) 0.0000 (0.0994)
Observations 156 156 156
R2 0.9048 0.2678 0.2678
Adjusted R2 0.8694 0.2484 -0.0044
Note: Standard Errors reported in parentheses, *p<0.1;**p<0.05;***p<0.01

We’ve changed a few of the stargazer options for this chapter. We’re displaying standard errors instead of p-values so that we can use only one row per variable (it lets us report coefficient and standard error on one line, but not if we use p-values instead). I modified the note to say that standard errors are reported in parentheses.

Note that for the PP and RP, you should report p-values instead of standard errors, so make sure to use the stargazer code chunks from the MLR chapter isntead of this one

Now look at the coefficient estimates. The 3 models all have the same coefficients on gdpPerCapita, pop, pctFemale, and pctRurla. In LN5 we discuss how the within transformation is equivalent to including dummy variables for each group (in this case, countries). That’s exactly what see in the table. The PLM package estimates the within transformation for us (so this is usually what you want to use in practice…we’re just doing it by hand here to help you better understand the models).

You also may notice that the standard errors (and statistical significance stars) are different in the middle column. When we estimate the model with dummy variables (column 1), the regular OLS standard errors are correct. But when we apply the within transformation, we need to adjust the standard errors to account for the within transformation. This would be a bit difficult for us to do. Thankfully, the PLM package correctly adjusts the standard errors (and thus p-values) for us. Thus, in practice we won’t actually want to apply the within transformation ourselves. We’re doing it in this chapter so you can see exactly what it is in practice and see that the coefficient estimates for all 3 versions result in the same coefficients.

If you compare the \(R^2\) values across models, you’ll notice that the \(R^2\) for the model with dummy variables is much higher. Including all the dummy variables makes it artificially high. We want to use the \(R^2\) from the within transformation. The PLM model does this for us.

Another reason we want to use the PLM model when we estimate fixed effects models is that we often don’t want to see all of the coefficients on the dummy variables. For country fixed effects, the coefficient on each country dummy is estimated off of only 4 observations. Thus, it is not a reliable estimate of the effect of being Argentina (or Belize, etc). It still allows us to estimate the model with country fixed effects, even if we don’t care about the coefficient estimates themselves. However, if we had not dropped all countries except South America, we would have hundreds of dummy variables. If we were estimating a model using US county data, we would have over 3000. R probably wouldn’t even let us estimate a model with that many variables. This again makes the PLM package preferable.

14.4 Year Fixed Effects

Above you saw how to estimate models with country fixed effects in three different ways. Here, you should estimate models with year fixed effects in the same three ways. Hint: you just have to switch “country” with “year” and everything else is the same. If you’ve done it correctly, the coefficients will be identical in all three models (and the standard errors will be identical in the “dummies” and “PLM” models).

## Dummy variable for each year (it automatically omits one)
yearDummies <- lm(lifeExp~gdpPerCapita+pop+pctFemale+pctRural+factor(year),data=mydata)


## Within transformation (subtract year averages from each observation for each variable)

## Create year averages and add them to mydata
mydata <-  mydata %>%
  group_by(year) %>%
  mutate(yAvg_lifeExp=mean(lifeExp),
         yAvg_gdpPerCapita=mean(gdpPerCapita),
         yAvg_pop=mean(pop),
         yAvg_pctFemale=mean(pctFemale),
         yAvg_pctRural=mean(pctRural)
         ) %>%
  ungroup()


## Within transformation (stored in its own dataframe so can use the same names)
mydataYear <- mydata %>% 
   mutate(lifeExp=lifeExp-yAvg_lifeExp,
         gdpPerCapita=gdpPerCapita-yAvg_gdpPerCapita,
         pop=pop-yAvg_pop,
         pctFemale=pctFemale-yAvg_pctFemale,
         pctRural=pctRural-yAvg_pctRural
         )


## Estimate within transformation using the transformed data
yearWithin <- lm(lifeExp~ gdpPerCapita+pop+pctFemale+pctRural, data = mydataYear)

## Using plm package (for year, still use model = "within", effect="individual")
yearPlm <- plm(lifeExp~gdpPerCapita+pop+pctFemale+pctRural,data=mydata, index = c("year"), model = "within", effect = "individual")
stargazer(yearDummies,yearWithin,yearPlm,
          type = "html",
          report=('vcs*'),
          single.row = TRUE,
          digits = 4,
          keep.stat = c("n","rsq","adj.rsq"),
          notes = "Standard Errors reported in parentheses, <em>&#42;p&lt;0.1;&#42;&#42;p&lt;0.05;&#42;&#42;&#42;p&lt;0.01</em>",
          notes.append = FALSE,
          title = "Year Fixed Effects",
          model.numbers = FALSE,
          column.labels = c("Dummies", "Within", "PLM"))
Year Fixed Effects
Dependent variable:
lifeExp
OLS panel
linear
Dummies Within PLM
gdpPerCapita 0.0952 (0.0198)*** 0.0952 (0.0196)*** 0.0952 (0.0198)***
pop -0.0016 (0.0070) -0.0016 (0.0069) -0.0016 (0.0070)
pctFemale 0.5188 (0.2555)** 0.5188 (0.2530)** 0.5188 (0.2555)**
pctRural -0.0607 (0.0136)*** -0.0607 (0.0134)*** -0.0607 (0.0136)***
factor(year)2021 -1.5027 (0.7033)**
factor(year)2022 0.7136 (0.7042)
factor(year)2023 1.2934 (0.7050)*
Constant 47.9116 (12.9335)*** -0.0000 (0.2461)
Observations 156 156 156
R2 0.4160 0.3641 0.3641
Adjusted R2 0.3884 0.3472 0.3340
Note: Standard Errors reported in parentheses, *p<0.1;**p<0.05;***p<0.01

14.5 Country and Year Fixed Effects

Now that you’ve estimated the models with year fixed effects, estimate models with both country and year fixed effects. It works the same way as above, just doing it for both country and year. If you’ve done it correctly, the coefficients will be identical in all three models (and the standard errors will be identical in the “dummies” and “PLM” models).

## Dummy variable for each country and each year (it automatically omits one of each)
countryyearDummies <- lm(lifeExp~gdpPerCapita+pop+pctFemale+pctRural+factor(year) + factor(country),data=mydata)

## Within transformation (subtract country AND year averages from each observation for each variable)
## We already created the country averages and year averages above so we don't need to create them again

## Within transformation (stored in its own dataframe so can use the same names)
mydataCountryYear <- mydata %>% 
  mutate(lifeExp=lifeExp-yAvg_lifeExp-cAvg_lifeExp ,
         gdpPerCapita=gdpPerCapita-yAvg_gdpPerCapita-cAvg_gdpPerCapita,
         pop=pop-yAvg_pop-cAvg_pop,
         pctFemale=pctFemale-yAvg_pctFemale-cAvg_pctFemale,
         pctRural=pctRural-yAvg_pctRural-cAvg_pctRural
         )

  

##Estimate within transformation using the transformed data
countryYearWithin <- lm(lifeExp~ gdpPerCapita+pop+pctFemale+pctRural, data = mydataCountryYear)

##Using plm package (using index = both country and year, joined together in c(), and model = "within", effect="twoways")
countryYearPlm <- plm(lifeExp~gdpPerCapita+pop+pctFemale+pctRural,data=mydata, index = c("year", "country"), model = "within", effect = "twoways")
stargazer(countryyearDummies,countryYearWithin, countryYearPlm,
          type = "html",
          report=('vcs*'),
          single.row = TRUE,
          digits = 4,
          keep.stat = c("n","rsq","adj.rsq"),
          notes = "Standard Errors reported in parentheses, <em>&#42;p&lt;0.1;&#42;&#42;p&lt;0.05;&#42;&#42;&#42;p&lt;0.01</em>",
          notes.append = FALSE,
          title = "Country and Year Fixed Effects",
          model.numbers = FALSE,
          column.labels = c("Dummies", "Within", "PLM"))
Country and Year Fixed Effects
Dependent variable:
lifeExp
OLS panel
linear
Dummies Within PLM
gdpPerCapita -0.0179 (0.0514) -0.0179 (0.0439) -0.0179 (0.0514)
pop 1.1628 (0.3299)*** 1.1628 (0.2816)*** 1.1628 (0.3299)***
pctFemale 0.8919 (2.4114) 0.8919 (2.0582) 0.8919 (2.4114)
pctRural 0.0669 (0.2351) 0.0669 (0.2006) 0.0669 (0.2351)
factor(year)2021 -1.4875 (0.2414)***
factor(year)2022 0.7580 (0.2920)**
factor(year)2023 1.2911 (0.3442)***
factor(country)Argentina -47.9744 (21.9488)**
factor(country)Aruba 0.3900 (8.7612)
factor(country)Bahamas, The -0.1935 (13.6778)
factor(country)Barbados 1.4152 (8.4746)
factor(country)Belize -2.1523 (8.6605)
factor(country)Bolivia -20.9873 (13.7444)
factor(country)Brazil -241.2185 (69.4851)***
factor(country)Cayman Islands 10.9321 (20.8092)
factor(country)Chile -14.1515 (17.5093)
factor(country)Colombia -56.6799 (20.9350)***
factor(country)Costa Rica 1.5321 (14.2088)
factor(country)Cuba -8.5747 (14.0636)
factor(country)Curacao 3.4450 (15.7141)
factor(country)Dominica -1.1593 (13.9136)
factor(country)Dominican Republic -12.1365 (13.5927)
factor(country)Ecuador -18.7657 (12.4866)
factor(country)El Salvador -10.4520 (11.4563)
factor(country)Grenada 0.6408 (7.5805)
factor(country)Guatemala -23.8208 (10.6736)**
factor(country)Guyana -9.0091 (3.0689)***
factor(country)Haiti -23.3040 (9.4876)**
factor(country)Honduras -13.3797 (11.5019)
factor(country)Jamaica -5.9266 (9.8233)
factor(country)Mexico -149.6151 (43.0099)***
factor(country)Nicaragua -8.9009 (9.6399)
factor(country)Panama 0.6516 (12.3687)
factor(country)Paraguay -8.2742 (13.0140)
factor(country)Peru -35.2422 (18.4545)*
factor(country)Puerto Rico (US) 3.7349 (16.2270)
factor(country)Sint Maarten (Dutch part) 4.5820 (18.6850)
factor(country)St. Kitts and Nevis -5.6164 (2.3446)**
factor(country)St. Lucia -3.9342 (4.9190)
factor(country)St. Vincent and the Grenadines -2.5335 (11.0071)
factor(country)Suriname -1.1204 (12.4046)
factor(country)Trinidad and Tobago -2.5721 (9.0207)
factor(country)Turks and Caicos Islands 7.7489 (18.7799)
factor(country)Uruguay 1.5000 (17.2314)
factor(country)Venezuela, RB -32.1640 (18.2571)*
Constant 25.5932 (131.2264) -7.1878 (106.0613)
Observations 156 156 156
R2 0.9570 0.1114 0.1114
Adjusted R2 0.9394 0.0879 -0.2521
Note: Standard Errors reported in parentheses, *p<0.1;**p<0.05;***p<0.01

14.6 Comparison of all models

Below we have comparisons of the four models: ols, country fixed effects, year fixed effects, and country and year fixed effects. The comparisons are done three times, one for each method of estimating the models.

14.6.1 Within Transformation

stargazer(ols,countryWithin,yearWithin,countryYearWithin,
          type = "html",
          report=('vcs*'),
          single.row = TRUE,
          digits = 3,
          keep.stat = c("n","rsq","adj.rsq"),
          notes = "Standard Errors reported in parentheses, <em>&#42;p&lt;0.1;&#42;&#42;p&lt;0.05;&#42;&#42;&#42;p&lt;0.01</em>",
          notes.append = FALSE,
          title = "Fixed Effects Models: Within Transformation",
          model.numbers = FALSE,
          column.labels = c("OLS", "Country FE", "Year FE", "Country+Year FE"))
Fixed Effects Models: Within Transformation
Dependent variable:
lifeExp
OLS Country FE Year FE Country+Year FE
gdpPerCapita 0.099 (0.021)*** 0.135 (0.055)** 0.095 (0.020)*** -0.018 (0.044)
pop -0.001 (0.007) 1.834 (0.393)*** -0.002 (0.007) 1.163 (0.282)***
pctFemale 0.525 (0.268)* 4.479 (2.860) 0.519 (0.253)** 0.892 (2.058)
pctRural -0.060 (0.014)*** -0.352 (0.282) -0.061 (0.013)*** 0.067 (0.201)
Constant 47.639 (13.543)*** 0.000 (0.099) -0.000 (0.246) -7.188 (106.061)
Observations 156 156 156 156
R2 0.346 0.268 0.364 0.111
Adjusted R2 0.329 0.248 0.347 0.088
Note: Standard Errors reported in parentheses, *p<0.1;**p<0.05;***p<0.01

14.6.2 PLM Package

stargazer(ols,countryPlm,yearPlm,countryYearPlm,
          type = "html",
          report=('vcs*'),
          single.row = TRUE,
          digits = 3,
          keep.stat = c("n","rsq","adj.rsq"),
          notes = "Standard Errors reported in parentheses, <em>&#42;p&lt;0.1;&#42;&#42;p&lt;0.05;&#42;&#42;&#42;p&lt;0.01</em>",
          notes.append = FALSE,
          title = "Fixed Effects Models: PLM Package",
          model.numbers = FALSE,
          column.labels = c("OLS", "Country FE", "Year FE", "Country+Year FE"))
Fixed Effects Models: PLM Package
Dependent variable:
lifeExp
OLS panel
linear
OLS Country FE Year FE Country+Year FE
gdpPerCapita 0.099 (0.021)*** 0.135 (0.064)** 0.095 (0.020)*** -0.018 (0.051)
pop -0.001 (0.007) 1.834 (0.455)*** -0.002 (0.007) 1.163 (0.330)***
pctFemale 0.525 (0.268)* 4.479 (3.307) 0.519 (0.256)** 0.892 (2.411)
pctRural -0.060 (0.014)*** -0.352 (0.327) -0.061 (0.014)*** 0.067 (0.235)
Constant 47.639 (13.543)***
Observations 156 156 156 156
R2 0.346 0.268 0.364 0.111
Adjusted R2 0.329 -0.004 0.334 -0.252
Note: Standard Errors reported in parentheses, *p<0.1;**p<0.05;***p<0.01

14.6.3 Dummy Variables

stargazer(ols,countryDummies,yearDummies,countryyearDummies,
          type = "html",
          report=('vcs*'),
          single.row = TRUE,
          digits = 3,
          keep.stat = c("n","rsq","adj.rsq"),
          notes = "Standard Errors reported in parentheses, <em>&#42;p&lt;0.1;&#42;&#42;p&lt;0.05;&#42;&#42;&#42;p&lt;0.01</em>",
          notes.append = FALSE,
          title = "Fixed Effects Models: Dummy Variables",
          model.numbers = FALSE,
          column.labels = c("OLS", "Country FE", "Year FE", "Country+Year FE"))
Fixed Effects Models: Dummy Variables
Dependent variable:
lifeExp
OLS Country FE Year FE Country+Year FE
gdpPerCapita 0.099 (0.021)*** 0.135 (0.064)** 0.095 (0.020)*** -0.018 (0.051)
pop -0.001 (0.007) 1.834 (0.455)*** -0.002 (0.007) 1.163 (0.330)***
pctFemale 0.525 (0.268)* 4.479 (3.307) 0.519 (0.256)** 0.892 (2.411)
pctRural -0.060 (0.014)*** -0.352 (0.327) -0.061 (0.014)*** 0.067 (0.235)
factor(country)Argentina -98.662 (29.770)*** -47.974 (21.949)**
factor(country)Aruba -18.275 (11.818) 0.390 (8.761)
factor(country)Bahamas, The -25.110 (18.988) -0.194 (13.678)
factor(country)Barbados -12.263 (11.931) 1.415 (8.475)
factor(country)Belize 1.947 (12.558) -2.152 (8.660)
factor(country)Bolivia -36.800 (19.899)* -20.987 (13.744)
factor(country)Brazil -401.021 (94.053)*** -241.218 (69.485)***
factor(country)Cayman Islands -20.580 (29.596) 10.932 (20.809)
factor(country)Chile -45.864 (24.563)* -14.151 (17.509)
factor(country)Colombia -105.501 (28.361)*** -56.680 (20.935)***
factor(country)Costa Rica -17.040 (20.402) 1.532 (14.209)
factor(country)Cuba -29.940 (20.026) -8.575 (14.064)
factor(country)Curacao -24.583 (21.825) 3.445 (15.714)
factor(country)Dominica -10.721 (20.341) -1.159 (13.914)
factor(country)Dominican Republic -30.637 (19.515) -12.137 (13.593)
factor(country)Ecuador -36.797 (17.903)** -18.766 (12.487)
factor(country)El Salvador -33.562 (15.673)** -10.452 (11.456)
factor(country)Grenada 6.484 (10.867) 0.641 (7.580)
factor(country)Guatemala -39.244 (15.312)** -23.821 (10.674)**
factor(country)Guyana -5.804 (4.333) -9.009 (3.069)***
factor(country)Haiti -33.610 (13.773)** -23.304 (9.488)**
factor(country)Honduras -21.911 (16.823) -13.380 (11.502)
factor(country)Jamaica -13.102 (14.356) -5.927 (9.823)
factor(country)Mexico -253.841 (57.590)*** -149.615 (43.010)***
factor(country)Nicaragua -19.768 (13.952) -8.901 (9.640)
factor(country)Panama -10.435 (18.021) 0.652 (12.369)
factor(country)Paraguay -19.883 (18.966) -8.274 (13.014)
factor(country)Peru -73.060 (25.546)*** -35.242 (18.454)*
factor(country)Puerto Rico (US) -30.779 (21.950) 3.735 (16.227)
factor(country)Sint Maarten (Dutch part) -25.051 (26.374) 4.582 (18.685)
factor(country)St. Kitts and Nevis -7.363 (3.426)** -5.616 (2.345)**
factor(country)St. Lucia 2.542 (6.839) -3.934 (4.919)
factor(country)St. Vincent and the Grenadines 1.780 (15.997) -2.533 (11.007)
factor(country)Suriname -8.424 (18.164) -1.120 (12.405)
factor(country)Trinidad and Tobago -8.873 (13.192) -2.572 (9.021)
factor(country)Turks and Caicos Islands -16.334 (26.982) 7.749 (18.780)
factor(country)Uruguay -27.230 (24.209) 1.500 (17.231)
factor(country)Venezuela, RB -68.998 (25.279)*** -32.164 (18.257)*
factor(year)2021 -1.503 (0.703)** -1.488 (0.241)***
factor(year)2022 0.714 (0.704) 0.758 (0.292)**
factor(year)2023 1.293 (0.705)* 1.291 (0.344)***
Constant 47.639 (13.543)*** -133.356 (183.584) 47.912 (12.934)*** 25.593 (131.226)
Observations 156 156 156 156
R2 0.346 0.905 0.416 0.957
Adjusted R2 0.329 0.869 0.388 0.939
Note: Standard Errors reported in parentheses, *p<0.1;**p<0.05;***p<0.01

14.7 Data Summary by Country

The remainder of this file has summaries of the data that are included to illustrate the within transformation. The colors in the tables for each variable make it easy to see the variation used when we use the within transformation, and thus that is used for identification in fixed effects models. For each variable, for each country you can clearly see which years are above that countries average and which years are below that country’s average.

14.7.1 Standard Summary Statistics

Statistic N Mean St. Dev. Min Pctl(25) Median Pctl(75) Max
lifeExp 156 73.748 3.970 61.427 71.224 73.688 76.668 81.690
gdpPerCapita 156 14.086 14.296 1.219 6.123 9.042 17.337 83.005
pop 156 16.697 38.720 0.041 0.155 3.394 11.847 211.141
pctFemale 156 50.746 0.992 48.753 49.965 50.516 51.405 52.882
pctRural 156 31.886 21.005 0.000 13.033 29.510 44.479 75.550

14.7.2 Average Values for Each Country

country Avg
lifeExp
Avg
gdpPerCapita
Avg
pop
Avg
pctFemale
Avg
pctRural
Antigua and Barbuda 77.36 16.57 0.09 52.43 75.46
Argentina 75.76 12.55 45.36 50.39 7.93
Aruba 75.41 27.41 0.11 52.81 38.09
Bahamas, The 73.20 29.78 0.40 52.12 18.55
Barbados 76.27 19.13 0.28 52.04 40.65
Belize 72.06 5.82 0.40 49.62 57.72
Bolivia 65.09 3.00 12.02 49.83 29.52
Brazil 74.57 8.89 209.91 50.75 12.75
Cayman Islands 79.72 78.87 0.07 49.76 0.00
Chile 79.64 13.82 19.51 50.29 11.45
Colombia 75.42 6.51 51.47 50.63 22.05
Costa Rica 79.47 13.35 5.07 50.55 21.79
Cuba 76.58 7.40 11.09 50.59 22.89
Curacao 76.43 16.14 0.15 52.45 8.60
Dominica 70.83 8.14 0.07 49.87 27.52
Dominican Republic 73.08 8.31 11.17 50.25 27.26
Ecuador 74.68 5.86 17.76 50.11 36.90
El Salvador 71.06 4.23 6.27 52.49 26.13
Grenada 74.97 9.10 0.12 49.74 63.67
Guatemala 70.41 4.28 17.73 50.39 44.92
Guyana 68.04 15.05 0.82 51.25 73.55
Haiti 63.82 1.28 11.44 50.45 46.46
Honduras 71.49 2.41 10.38 49.64 42.41
Jamaica 70.87 5.75 2.84 50.50 42.23
Mexico 72.31 9.81 128.20 51.45 20.93
Nicaragua 72.66 2.12 6.69 50.83 41.08
Panama 78.06 15.01 4.37 49.97 34.18
Paraguay 71.75 6.26 6.72 49.81 32.15
Peru 75.00 6.40 33.33 50.24 15.84
Puerto Rico (US) 80.22 29.05 3.24 52.82 5.91
Sint Maarten (Dutch part) 75.51 31.64 0.04 51.25 0.00
St. Kitts and Nevis 70.73 20.17 0.05 51.95 68.42
St. Lucia 71.70 10.10 0.18 50.50 72.15
St. Vincent and the Grenadines 70.29 8.45 0.10 48.89 52.48
Suriname 72.04 7.11 0.62 49.95 34.09
Trinidad and Tobago 72.64 15.72 1.37 50.56 46.05
Turks and Caicos Islands 77.66 44.87 0.05 49.89 6.43
Uruguay 77.11 17.62 3.39 51.50 4.53
Venezuela, RB 72.25 1.34 28.30 50.53 10.81

14.7.3 Variable-Specific Values and Within Transformation for Each Country

For each variable, display each country’s values in 2020, 2021, 2022, and 2023, followed by the country’s average. These 5 columns are shaded from red (lowest) to green (highest) for each country. Then, in the final 4 columns display the within transformation (i.e., subtract the country’s average from each year’s value). These last 4 columns are also shaded for each country.

14.7.4 Life expectancy

iso3c 2020
Life Exp
2021
Life Exp
2022
Life Exp
2023
Life Exp
Avg
Life Exp
2020
Within
2021
Within
2022
Within
2023
Within
ABW 75.41 73.66 76.23 76.35 75.41 0.00 -1.75 0.82 0.94
ARG 75.88 73.95 75.81 77.39 75.76 0.12 -1.81 0.05 1.64
ATG 77.16 77.20 77.48 77.60 77.36 -0.20 -0.16 0.12 0.24
BHS 72.99 70.75 74.49 74.55 73.20 -0.20 -2.45 1.29 1.35
BLZ 71.58 70.92 72.19 73.57 72.06 -0.48 -1.15 0.13 1.50
BOL 62.91 61.43 67.43 68.58 65.09 -2.18 -3.66 2.35 3.49
BRA 74.51 73.04 74.87 75.85 74.57 -0.06 -1.53 0.31 1.28
BRB 76.65 76.58 75.68 76.18 76.27 0.38 0.31 -0.59 -0.09
CHL 79.35 78.88 79.18 81.17 79.64 -0.29 -0.77 -0.47 1.53
COL 74.76 72.70 76.51 77.72 75.42 -0.66 -2.72 1.09 2.30
CRI 79.72 78.05 79.32 80.80 79.47 0.25 -1.42 -0.16 1.33
CUB 77.41 73.20 77.63 78.08 76.58 0.83 -3.38 1.05 1.50
CUW 76.50 75.69 76.73 76.80 76.43 0.07 -0.74 0.30 0.37
CYM 79.23 79.30 79.98 80.36 79.72 -0.49 -0.42 0.27 0.64
DMA 71.27 69.83 71.08 71.13 70.83 0.44 -1.00 0.25 0.30
DOM 72.64 71.76 74.21 73.72 73.08 -0.45 -1.32 1.13 0.64
ECU 72.00 72.75 76.58 77.39 74.68 -2.68 -1.93 1.90 2.71
GRD 75.02 74.52 75.15 75.20 74.97 0.04 -0.45 0.18 0.23
GTM 69.97 67.86 71.21 72.60 70.41 -0.44 -2.55 0.80 2.19
GUY 67.75 64.32 69.89 70.18 68.04 -0.28 -3.71 1.85 2.14
HND 70.86 69.49 72.72 72.88 71.49 -0.62 -2.00 1.23 1.40
HTI 63.77 62.61 63.95 64.94 63.82 -0.04 -1.20 0.13 1.12
JAM 71.45 69.08 71.48 71.48 70.87 0.58 -1.79 0.61 0.60
KNA 71.18 69.27 70.31 72.14 70.73 0.45 -1.46 -0.41 1.42
LCA 72.31 69.12 72.67 72.70 71.70 0.61 -2.58 0.97 1.00
MEX 70.45 69.75 73.97 75.07 72.31 -1.86 -2.56 1.66 2.76
NIC 70.77 70.48 74.46 74.95 72.66 -1.90 -2.19 1.80 2.28
PAN 76.33 77.00 79.32 79.59 78.06 -1.73 -1.06 1.26 1.53
PER 73.83 71.60 76.83 77.74 75.00 -1.17 -3.40 1.83 2.74
PRI 80.01 79.77 79.43 81.69 80.22 -0.22 -0.45 -0.80 1.47
PRY 72.72 68.11 72.32 73.84 71.75 0.97 -3.64 0.57 2.10
SLV 70.24 69.94 71.97 72.10 71.06 -0.82 -1.12 0.91 1.04
SUR 72.32 68.94 73.25 73.63 72.04 0.28 -3.09 1.22 1.59
SXM 75.00 74.50 76.18 76.37 75.51 -0.51 -1.01 0.67 0.86
TCA 77.50 77.23 77.92 78.01 77.66 -0.17 -0.43 0.25 0.34
TTO 72.64 71.11 73.33 73.49 72.64 0.00 -1.53 0.69 0.85
URY 78.38 75.43 76.47 78.14 77.11 1.28 -1.67 -0.64 1.03
VCT 69.61 69.13 71.19 71.23 70.29 -0.68 -1.16 0.90 0.94
VEN 72.37 71.54 72.57 72.51 72.25 0.12 -0.71 0.32 0.27

14.7.5 GDP per capita

iso3c 2020
GDP per Capita
2021
GDP per Capita
2022
GDP per Capita
2023
GDP per Capita
Avg
GDP per Capita
2020
Within
2021
Within
2022
Within
2023
Within
ABW 22729.89 26292.92 29195.27 31430.94 27412.25 -4.68 -1.12 1.78 4.02
ARG 11393.05 12549.28 13276.82 12993.09 12553.06 -1.16 0.00 0.72 0.44
ATG 14950.89 16084.72 17456.87 17789.41 16570.47 -1.62 -0.49 0.89 1.22
BHS 24791.67 29114.06 32186.46 33009.65 29775.46 -4.98 -0.66 2.41 3.23
BLZ 5006.48 5839.40 6262.56 6165.69 5818.54 -0.81 0.02 0.44 0.35
BOL 2765.09 3011.55 3088.24 3122.77 2996.91 -0.23 0.01 0.09 0.13
BRA 8435.01 8799.23 9032.08 9288.03 8888.59 -0.45 -0.09 0.14 0.40
BRB 17519.84 17475.03 20472.95 21068.26 19134.02 -1.61 -1.66 1.34 1.93
CHL 12679.02 14051.47 14283.15 14280.35 13823.50 -1.14 0.23 0.46 0.46
COL 5891.96 6457.17 6856.73 6828.60 6508.61 -0.62 -0.05 0.35 0.32
CRI 12242.21 13146.69 13686.16 14318.84 13348.48 -1.11 -0.20 0.34 0.97
CUB 7252.29 7379.04 7552.33 7433.43 7404.27 -0.15 -0.03 0.15 0.03
CUW 14849.97 15625.41 16772.81 17326.96 16143.79 -1.29 -0.52 0.63 1.18
CYM 75199.64 77259.63 80029.03 83005.48 78873.45 -3.67 -1.61 1.16 4.13
DMA 7302.94 7738.32 8590.92 8946.99 8144.79 -0.84 -0.41 0.45 0.80
DOM 7395.87 8344.91 8698.14 8809.96 8312.22 -0.92 0.03 0.39 0.50
ECU 5355.69 5815.09 6107.49 6174.82 5863.27 -0.51 -0.05 0.24 0.31
GRD 8413.28 8782.32 9406.19 9817.86 9104.92 -0.69 -0.32 0.30 0.71
GTM 4005.84 4268.63 4385.15 4470.71 4282.58 -0.28 -0.01 0.10 0.19
GUY 9010.61 10712.00 17365.33 23101.35 15047.32 -6.04 -4.34 2.32 8.05
HND 2189.43 2423.77 2482.22 2527.27 2405.67 -0.22 0.02 0.08 0.12
HTI 1331.70 1292.72 1256.72 1219.12 1275.06 0.06 0.02 -0.02 -0.06
JAM 5317.84 5607.45 5965.46 6127.91 5754.67 -0.44 -0.15 0.21 0.37
KNA 18918.83 19031.82 21050.76 21664.03 20166.36 -1.25 -1.13 0.88 1.50
LCA 8379.27 9336.92 11224.29 11440.08 10095.14 -1.72 -0.76 1.13 1.34
MEX 9234.64 9728.06 10013.25 10259.18 9808.78 -0.57 -0.08 0.20 0.45
NIC 1950.19 2128.31 2175.74 2241.12 2123.84 -0.17 0.00 0.05 0.12
PAN 12647.08 14552.94 15956.07 16877.15 15008.31 -2.36 -0.46 0.95 1.87
PER 5831.83 6547.85 6667.52 6568.00 6403.80 -0.57 0.14 0.26 0.16
PRI 28144.72 28416.62 29643.74 30012.92 29054.50 -0.91 -0.64 0.59 0.96
PRY 6109.20 6278.11 6218.20 6449.23 6263.68 -0.15 0.01 -0.05 0.19
SLV 3808.53 4247.55 4355.96 4489.18 4225.30 -0.42 0.02 0.13 0.26
SUR 7213.11 6973.90 7081.33 7186.47 7113.70 0.10 -0.14 -0.03 0.07
SXM 28920.38 29834.64 33523.60 34300.96 31644.89 -2.72 -1.81 1.88 2.66
TCA 33739.43 42907.75 48307.31 54523.03 44869.38 -11.13 -1.96 3.44 9.65
TTO 15679.96 15558.09 15712.23 15922.77 15718.26 -0.04 -0.16 -0.01 0.20
URY 16443.36 17416.01 18228.36 18378.98 17616.68 -1.17 -0.20 0.61 0.76
VCT 7989.75 8211.34 8532.74 9051.35 8446.29 -0.46 -0.23 0.09 0.61
VEN 1255.37 1276.62 1379.98 1430.75 1335.68 -0.08 -0.06 0.04 0.10

14.7.6 Population

iso3c 2020
Population
2021
Population
2022
Population
2023
Population
Avg
Population
2020
Within
2021
Within
2022
Within
2023
Within
ABW 108587 107700 107310 107359 107739.00 0.00 0.00 0.00 0.00
ARG 45191965 45312281 45407904 45538401 45362637.75 -0.17 -0.05 0.05 0.18
ATG 91846 92349 92840 93316 92587.75 0.00 0.00 0.00 0.00
BHS 395863 396373 397538 399440 397303.50 0.00 0.00 0.00 0.00
BLZ 390812 395346 402733 411106 399999.25 -0.01 0.00 0.00 0.01
BOL 11816299 11937360 12077154 12244159 12018743.00 -0.20 -0.08 0.06 0.23
BRA 208660842 209550294 210306415 211140729 209914570.00 -1.25 -0.36 0.39 1.23
BRB 281698 282147 282318 282336 282124.75 0.00 0.00 0.00 0.00
CHL 19370624 19456334 19553036 19658835 19509707.25 -0.14 -0.05 0.04 0.15
COL 50629997 51188173 51737944 52321152 51469316.50 -0.84 -0.28 0.27 0.85
CRI 5034320 5059988 5081765 5105525 5070399.50 -0.04 -0.01 0.01 0.04
CUB 11176354 11122168 11059820 11019931 11094568.25 0.08 0.03 -0.03 -0.07
CUW 155482 153948 153321 154654 154351.25 0.00 0.00 0.00 0.00
CYM 68684 70108 71591 73038 70855.25 0.00 0.00 0.00 0.00
DMA 67573 67202 66826 66510 67027.75 0.00 0.00 0.00 0.00
DOM 11008300 11123476 11230734 11331265 11173443.75 -0.17 -0.05 0.06 0.16
ECU 17546065 17682454 17823897 17980083 17758124.75 -0.21 -0.08 0.07 0.22
GRD 116341 116688 116913 117081 116755.75 0.00 0.00 0.00 0.00
GTM 17357325 17598650 17847877 18124838 17732172.50 -0.37 -0.13 0.12 0.39
GUY 807481 815482 821637 826353 817738.25 -0.01 0.00 0.00 0.01
HND 10119640 10289877 10463872 10644851 10379560.00 -0.26 -0.09 0.08 0.27
HTI 11243848 11374586 11503606 11637398 11439859.50 -0.20 -0.07 0.06 0.20
JAM 2830739 2837682 2839144 2839786 2836837.75 -0.01 0.00 0.00 0.00
KNA 46870 46763 46709 46758 46775.00 0.00 0.00 0.00 0.00
LCA 178250 178522 178781 179285 178709.50 0.00 0.00 0.00 0.00
MEX 126799054 127648148 128613117 129739759 128200019.50 -1.40 -0.55 0.41 1.54
NIC 6565267 6644741 6730654 6823613 6691068.75 -0.13 -0.05 0.04 0.13
PAN 4293261 4345405 4400773 4458759 4374549.50 -0.08 -0.03 0.03 0.08
PER 32838579 33155882 33475438 33845617 33328879.00 -0.49 -0.17 0.15 0.52
PRI 3281590 3262711 3220137 3203792 3242057.50 0.04 0.02 -0.02 -0.04
PRY 6603739 6684182 6760464 6844146 6723132.75 -0.12 -0.04 0.04 0.12
SLV 6234673 6255782 6280319 6309624 6270099.50 -0.04 -0.01 0.01 0.04
SUR 612317 617896 623164 628886 620565.75 -0.01 0.00 0.00 0.01
SXM 41008 41571 42139 42749 41866.75 0.00 0.00 0.00 0.00
TCA 44386 45243 45847 46198 45418.50 0.00 0.00 0.00 0.00
TTO 1366725 1367558 1365805 1367510 1366899.50 0.00 0.00 0.00 0.00
URY 3398968 3396695 3390913 3388081 3393664.25 0.01 0.00 0.00 -0.01
VCT 103526 102841 102046 101323 102434.00 0.00 0.00 0.00 0.00
VEN 28444077 28237826 28213017 28300854 28298943.50 0.15 -0.06 -0.09 0.00

14.7.7 Percent female

iso3c 2020
%Female
2021
%Female
2022
%Female
2023
%Female
Avg
%Female
2020
Within
2021
Within
2022
Within
2023
Within
ABW 52.84 52.83 52.79 52.77 52.81 0.03 0.02 -0.02 -0.04
ARG 50.39 50.39 50.39 50.38 50.39 0.00 0.01 0.00 -0.01
ATG 52.46 52.44 52.42 52.41 52.43 0.02 0.01 -0.01 -0.02
BHS 52.03 52.09 52.14 52.21 52.12 -0.08 -0.03 0.03 0.09
BLZ 49.65 49.69 49.62 49.53 49.62 0.03 0.07 -0.01 -0.09
BOL 49.73 49.82 49.87 49.89 49.83 -0.10 -0.01 0.05 0.06
BRA 50.71 50.73 50.76 50.78 50.75 -0.04 -0.01 0.01 0.04
BRB 52.04 52.03 52.04 52.06 52.04 0.00 -0.01 0.00 0.02
CHL 50.27 50.29 50.30 50.30 50.29 -0.02 0.00 0.01 0.01
COL 50.60 50.63 50.65 50.65 50.63 -0.03 0.00 0.02 0.02
CRI 50.52 50.55 50.57 50.58 50.55 -0.03 -0.01 0.01 0.03
CUB 50.52 50.57 50.62 50.64 50.59 -0.07 -0.02 0.03 0.06
CUW 52.48 52.45 52.45 52.44 52.45 0.02 0.00 -0.01 -0.02
CYM 49.75 49.73 49.76 49.79 49.76 -0.01 -0.02 0.00 0.03
DMA 49.83 49.84 49.87 49.94 49.87 -0.04 -0.03 0.00 0.07
DOM 50.21 50.24 50.26 50.27 50.25 -0.03 -0.01 0.01 0.03
ECU 50.07 50.11 50.13 50.14 50.11 -0.04 0.00 0.02 0.03
GRD 49.67 49.71 49.76 49.82 49.74 -0.07 -0.03 0.02 0.08
GTM 50.37 50.39 50.41 50.41 50.39 -0.02 0.00 0.01 0.01
GUY 51.18 51.24 51.27 51.30 51.25 -0.07 -0.01 0.02 0.05
HND 49.62 49.63 49.64 49.65 49.64 -0.02 0.00 0.01 0.01
HTI 50.41 50.44 50.46 50.49 50.45 -0.04 -0.01 0.01 0.04
JAM 50.47 50.49 50.51 50.53 50.50 -0.03 -0.01 0.01 0.03
KNA 51.80 51.92 52.01 52.08 51.95 -0.15 -0.03 0.06 0.12
LCA 50.41 50.48 50.54 50.58 50.50 -0.09 -0.03 0.03 0.08
MEX 51.39 51.44 51.48 51.50 51.45 -0.06 -0.01 0.03 0.04
NIC 50.83 50.84 50.84 50.82 50.83 0.00 0.01 0.00 -0.01
PAN 49.95 49.97 49.98 49.99 49.97 -0.02 0.00 0.01 0.02
PER 50.19 50.24 50.26 50.26 50.24 -0.05 0.00 0.02 0.02
PRI 52.74 52.80 52.85 52.88 52.82 -0.08 -0.02 0.03 0.07
PRY 49.77 49.80 49.83 49.85 49.81 -0.04 -0.01 0.02 0.03
SLV 52.48 52.49 52.50 52.50 52.49 -0.01 0.00 0.01 0.01
SUR 49.88 49.92 49.97 50.01 49.95 -0.07 -0.02 0.02 0.07
SXM 51.34 51.22 51.19 51.27 51.25 0.09 -0.04 -0.06 0.01
TCA 49.84 49.89 49.91 49.93 49.89 -0.05 -0.01 0.02 0.03
TTO 50.56 50.57 50.55 50.54 50.56 0.01 0.01 -0.01 -0.01
URY 51.50 51.50 51.51 51.51 51.50 0.00 0.00 0.00 0.00
VCT 48.75 48.87 48.94 49.01 48.89 -0.14 -0.03 0.05 0.12
VEN 50.49 50.52 50.55 50.57 50.53 -0.05 -0.01 0.02 0.04

14.7.8 Percent rural

iso3c 2020
%Rural
2021
%Rural
2022
%Rural
2023
%Rural
Avg
%Rural
2020
Within
2021
Within
2022
Within
2023
Within
ABW 38.00 38.07 38.12 38.16 38.09 -0.09 -0.02 0.03 0.08
ARG 8.06 7.97 7.89 7.81 7.93 0.13 0.04 -0.04 -0.12
ATG 75.36 75.43 75.49 75.55 75.46 -0.10 -0.03 0.03 0.09
BHS 18.34 18.52 18.68 18.68 18.55 -0.22 -0.03 0.13 0.12
BLZ 57.35 57.61 57.86 58.05 57.72 -0.37 -0.11 0.14 0.34
BOL 29.96 29.65 29.36 29.08 29.52 0.44 0.14 -0.15 -0.43
BRA 13.09 12.86 12.65 12.38 12.75 0.34 0.12 -0.10 -0.36
BRB 40.70 40.68 40.65 40.58 40.65 0.05 0.03 0.00 -0.07
CHL 11.70 11.53 11.36 11.18 11.45 0.26 0.09 -0.09 -0.26
COL 22.36 22.17 21.95 21.72 22.05 0.31 0.11 -0.10 -0.33
CRI 22.48 22.01 21.56 21.12 21.79 0.69 0.22 -0.23 -0.67
CUB 22.89 22.90 22.89 22.87 22.89 0.00 0.01 0.00 -0.02
CUW 8.62 8.61 8.60 8.59 8.60 0.01 0.00 -0.01 -0.01
CYM 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
DMA 28.15 27.74 27.32 26.89 27.52 0.63 0.21 -0.21 -0.64
DOM 26.74 27.08 27.58 27.64 27.26 -0.52 -0.18 0.32 0.38
ECU 36.92 36.91 36.91 36.87 36.90 0.02 0.01 0.01 -0.03
GRD 63.79 63.72 63.63 63.54 63.67 0.12 0.05 -0.04 -0.13
GTM 45.45 45.10 44.74 44.39 44.92 0.53 0.18 -0.18 -0.53
GUY 73.57 73.56 73.55 73.53 73.55 0.02 0.01 0.00 -0.02
HND 43.13 42.64 42.16 41.69 42.41 0.72 0.24 -0.24 -0.72
HTI 47.37 46.75 46.15 45.55 46.46 0.91 0.30 -0.31 -0.90
JAM 42.89 42.46 42.01 41.55 42.23 0.66 0.23 -0.22 -0.68
KNA 68.53 68.46 68.38 68.30 68.42 0.11 0.04 -0.03 -0.12
LCA 74.25 72.56 70.90 70.90 72.15 2.10 0.40 -1.25 -1.25
MEX 21.32 21.07 20.80 20.53 20.93 0.39 0.14 -0.13 -0.40
NIC 41.30 41.14 41.00 40.87 41.08 0.22 0.06 -0.07 -0.20
PAN 34.21 34.19 34.18 34.14 34.18 0.03 0.01 0.00 -0.04
PER 16.47 16.05 15.63 15.22 15.84 0.63 0.21 -0.21 -0.63
PRI 5.99 5.94 5.89 5.82 5.91 0.08 0.03 -0.02 -0.09
PRY 33.88 32.69 31.36 30.65 32.15 1.74 0.55 -0.79 -1.49
SLV 26.94 26.32 25.85 25.39 26.13 0.82 0.19 -0.27 -0.73
SUR 33.99 34.01 34.10 34.24 34.09 -0.10 -0.07 0.01 0.16
SXM 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
TCA 6.80 6.55 6.31 6.07 6.43 0.37 0.12 -0.13 -0.37
TTO 46.06 46.06 46.05 46.05 46.05 0.01 0.00 0.00 -0.01
URY 4.60 4.55 4.50 4.46 4.53 0.07 0.02 -0.02 -0.07
VCT 52.67 52.54 52.41 52.28 52.48 0.20 0.07 -0.06 -0.20
VEN 10.86 10.82 10.79 10.75 10.81 0.05 0.02 -0.02 -0.05