Dummy variables

The first alternative is to manually create one dummy for each category of the variable.

Example
Variable  
Educational
attainment
Categories
1=Compulsory           
2=Upper secondary
3=University 
Dummy
1=Compulsory, 0=Other
1=Upper secondary, 0=Other
1=University, 0=Other

For example:

gen educ_comp=educ
gen educ_uppsec=educ
gen educ_uni=educ
gen educ_comp (1=1) (2=0) (3=0)
gen educ_upsec (1=0) (2=1) (3=0)
gen educ_uni (1=0) (2=0) (3=1)

In the regression analysis, all dummies for the specific variable should be included as x-variables, except one. The dummy that you exclude – and it is your own choice which one you exclude – will be the “reference category”. Each of the other dummies will be compared to the dummy that is excluded.