Tag Archives: econometrics

New evidence on WTO membership after the Uruguay Round: an analysis at the sectoral level.

Magnus dos Reis (Unisinos), André Filipe Zago de Azevedo (CNPq), and I have a forthcoming paper at Open Economies Review that examines the effects of WTO membership on trade flows, with a special focus on sectoral trade flows. The full paper is available upon request.

Abstract

The creation of the World Trade Organization in 1995 brought several changes to the world trade system, including more stringent accession commitments, separate agreements for agricultural products and for textiles and garment. This study examines the effects of WTO membership on disaggregated sectoral trade flows and their extensive and intensive margins by means of a gravity model estimated by Poisson pseudo-maximum likelihood. We employ a panel dataset on bilateral imports for agriculture, textile, and manufacturing sectors for the 1995–2017 period. Our estimates suggest that WTO membership has succeeded in expanding trade flows for new members. Nevertheless, this growth occurred asymmetrically between developed and developing countries, and among the different types of products. In the period under review, developing countries benefited most from this WTO-promoted increase in world trade, in stark contrast to the findings of the extant literature for 1950–2000. The largest trade growth occurred in the agriculture sector, which is also at odds with earlier findings of growth in manufacturing products only. Furthermore, our results show that the increase in trade due to WTO liberalization took place exclusively in the extensive margin of trade, most of which also happened in the agricultural sector.

 

An introductory book on econometrics using R

A major issue with introductory econometric textbooks is that they are either too theoretical or too practical. While the former does not motivate students, the latter provides training and not an education. It is very difficult to reach a compromise between these two types. Nevertheless, there is a book that was able to get a good balance between theory and applications using R. It is titled “Introduction to Econometrics with R” and written by Christoph Hanck, Martin Arnold, Alexander Gerber, and Martin Schmelzer. Most important, the examples and applications presented in the book are carefully chosen to illustrate the theoretical aspects that are being discussed. For those that already know basic econometrics, this book is still useful to learn a lot about R.

A comprehensive road map to learn R

Learning a new software or even a new programming language is always an interesting journey. Most of the times the tutorials and books we find are never exactly what we need. A useful resource that I found is the Big Book of R. It is one of the most comprehensive repositories of tutorials and general information about R. You can find suggestions according to your needs or even according to your background, for instance for Journalism, Social Sciences, or Life Sciences.  It has very good sections on Machine Learning and on R programming.

Stata tip: creating a local containing all (or almost all) variables of the data set

Locals containing a list of variables can be very useful when using Stata. A common need is a local containing all variables of a data set. This local can be created by means of the ds command.

Here is an example using the lifeexp.dta data file.

. webuse lifeexp, clear
(Life expectancy, 1998)

Now, let’s create a local named allvar that will contain all variables of this data set.

. ds
region country popgrowth lexp gnppc safewater

. local allvar `r(varlist)’

. di “`allvar'”
region country popgrowth lexp gnppc safewater

 

We can see that ds stored the variable list into r(varlist). One interesting variation is the creation of a local containing all variables except region. You will need to specify the variables to be escluded right after ds, and add the option not after a comma.

. ds region, not
country popgrowth lexp gnppc safewater

. local othervar `r(varlist)’

. di “`othervar'”
country popgrowth lexp gnppc safewater

The command ds has several other useful applications that will be commented later in this blog.

 

A few tips for programming in Stata

Stata is a very powerful and useful statistical software. Just like any sophisticated tool, it takes time to learn about it. And you need to invest some time to master it. Programming is one of those skills that knowing a little bit can be very beneficial. Below you will find four videos. The first video goes over the functionalities of the Stata Program Editor. The second video covers some basics of Stata commands. The third video talks about loops, which are an essential tool for programmers. Finally, the fourth video is about macros, which together with loops are very useful to handle repetitive tasks.

How to use the Stata Program editor:

Basics of Stata:

Quick guide to loops:

More about macros:

A good tutorial for learning the basics of Python for data analysis

I founds this interesting tutorial for Python. In my opinion, Python is a very simple and intuitive language, and at the same time it is very powerful. This link leads to a straightforward tutorial of Python that focuses on the basic knowledge needed to use Python for data analysis.