Change Between Trade and Growth

Learn if trade and growth change over time.

We'll cover the following

So far, we’ve focused on estimating the correlation coefficient for the whole sample period. One important practical issue of interest is whether this correlation is stable over time or not. Since we have data from 1960 to 2009, it should make sense that we double-check whether the weak positive correlation changes over time.

Data manipulation

We’ll use the data on trade and growth to understand data manipulation. This exercise also gives us an opportunity to introduce a very new but powerful package,dplyr, which provides many useful tools for efficient data manipulation. The package has five main manipulation functions:

  • filter() is for selecting rows.
  • select() is for selecting columns.
  • arrange() is for reordering rows.
  • mutate() is for adding new columns, based on other columns.
  • summarize() is for calculating any function within groups.

Another important feature of dplyr is that it allows us to chain or pipe commands using the operator %>% so that we can carry out operations sequentially, making the code easier to read and understand.

Get hands-on with 1200+ tech skills courses.