Skip to main content

2.3 Retrieving variables into a dataset

The next step is to fill your dataset with relevant variables.

All underlying variables in microdata.no are basically organized in the same way; as events:

individual id-number x value x start date x stop date

Microdata.no further distinguishes between four types of variables:

  1. Longitudinal variables with sequences of events (each observation represents a state change, i.e. the variable changes value, with varying start and stop dates)

  2. Fixed variables with only one observation per unit (fixed information such as gender, date of birth, country of birth)

  3. Cross-sectional variables measured at fixed times (this is mainly variables used for statistical purposes, where start date = stop date and only the value at this particular time in question is known)

  4. Accumulated variables - mainly economical data on yearly income, wealth etc

Datasets are built by using the command import, with a measurement date usually specified (the exception is variables with constant values ​​such as gender).

Section 2.3.1 shows in detail how to use the command import to import variables into a dataset in the case with individuals as unit level. Section 2.3.2 shows alternative imports of variables with events as units (persons are represented by several observations over time, depending on the number of events that have occurred). In this case, the relevant command to use is import-event.