Paneldata analysis

Paneldata analysis is an advanced form of linear regression analysis where timedependent variance is adjusted for. This type of analysis has similarities with basic regression analysis (OLS). Among others, the dependent variable (listed first in the regress-panel expression) is required to measure continuous/metrical values only, e.g. income.

The main difference from OLS (the commando regress) is the way the data need to be organized: A panel format is required, i.e. all variables are to be measured more than one time depending on the number of measurement dates specified through the commando import-panel. A panel dataset will consist of T x N observations/records, where T equals the number of measurment while N represents the population size.

Note: Panel datasets can be very sizeable as each unit is measured more than once, for example by analysing the total population by using 2 measurements the dataset will typically consist of approximately 10 million observations (5 mill. x 2). Thus, use as small populations as necessary, preferably below 1 mill. units. Otherwise the system may be stressed and the executions more timeconsuming as a result.

//Create panel dataset (should be as small as necessary)
//Population: Individuals that completed a masters degree during the autumn semester 2010
create-dataset populasjon
import NUDB_AAR_FORSTE_FULLF_HOV as fullf_master
keep if fullf_master > 201007 & fullf_master < 201101

//Create a new and empty dataset consisting of the units from the dataset "populasjon"
clone-units populasjon paneldata

//Import a set of variables with specific time measurments into the empty dataset
use paneldata
import-panel INNTEKT_WLONN SIVSTANDFDT_SIVSTAND BOSATTEFDT_BOSTED 2011-12-31 2012-12-31 2013-12-31 2014-12-31 2015-12-31

//Recode and run descriptive analysis
rename INNTEKT_WLONN årslønn
generate gift = 0
replace gift = 1 if SIVSTANDFDT_SIVSTAND == '2'
generate oslo = 0
replace oslo = 1 if BOSATTEFDT_BOSTED == '0301'

tabulate-panel gift
tabulate-panel oslo
tabulate-panel gift oslo

summarize-panel årslønn
transitions-panel oslo gift

//Execute paneldata regression using fixed and random effects respectively 
regress-panel årslønn gift oslo, fe
regress-panel årslønn gift oslo, re