Stacked graphs in Stata

For plotting the relative importance of (e.g.) input shares, it can be useful to stack them in a figure. In my specific problem, I wanted to show the development of low-, medium-, and high-skilled labour inputs, relative to all labour inputs over time. Since the three shares obviously sum up to 1, I wanted to have a figure like this: Continue reading “Stacked graphs in Stata”

Econometrics Handbook (online)

Econometrics Handbook (American Economic Association – Committee for Economic Education)

Four modules of An Online Handbook on using current econometric methods in economic education research are now posted on the Committee for Economic Education’s web page. Each module includes relevant data and LIMDEP, STATA, and SAS programs. They were developed by William Becker and coauthors. The topics are:

  • Module 1: Data Management and Heteroskedasticity
  • Module 2: Endogenous Regressors with Natural Experiments, Instrumental Variables, and Two-stage Estimators
  • Module 3: (with W. Greene and J. Siegfried): Panel Data
  • Module 4: (with W. Greene): Sample Selection

All are available here:
https://www.aeaweb.org/about-aea/committees/economic-education/econometrics-training-modules

Ado-files: check and install automatically

If you need a certain ado-file to run your do-file and you are working on different computers, there is a way that Stata checks whether the needed ado-files are installed and that needed ado-files are automatically installed if they are not yet Continue reading “Ado-files: check and install automatically”

Weekly data: calendar week vs. Stata weeks

In my dataset, I have information on a number of workers for each week. The raw data I receive (no Stata format) contains information on the year and the week (1, 2, …, 52). Here, a week is defined as the first week of a year which has at least 4 days in January. E.g., the week 1/2009 starts already on December 29, 2008. A result of that is that for some years, a year has 53 calendar weeks. Continue reading “Weekly data: calendar week vs. Stata weeks”

Prevent variable abbreviation in Stata

In many cases, variable abbreviation is a handy tool in Stata (e.g. writing w instead of wage if wage is the only variable name starting with w). When using large numbers of variables with similar names, however, it can be quite dangerous, especially when do-files are run at once.

An easy way to prevent any variable abbreviation is stating:

set varabbrev off, permanent

Managing time variables in Stata and SPSS

I just came across the problem that a date in Stata is not the same as a date in SPSS. They are, however, based on the same principle: time variables, e.g. a variable containing days, contain the number of elapsed time units (days, weeks, months, seconds, or other date units) since a base date which is defined by the software.

In Stata, the base date is the first time unit in 1960 (e.g. January 1, 1960). For other time units, Continue reading “Managing time variables in Stata and SPSS”