:PROPERTIES:
:ID: 2e206d1d-aa77-4baa-9a71-af5737895178
:END:
#+title: 2016-10-17

* Quantitative :academia:UoN:@personal:
:PROPERTIES:
:CREATED: [2016-10-17 Mon 12:22]
:MODIFIED: [2016-10-17 Mon 13:41]
:IMPORTED: [2023-02-08 Wed 19:22]
:END:

Stata /SE14.2

Comments start with *

label variable id "id of respondent" // label a variable

codebook gender // displays the codebook

label define genderlab 1 "Female" 2 "Male" // names values to genderlab values

label values gender genderlab // links gender to genderlab

set more off

describe //describes the dataset

codebook //displays the entire codebook

mvdecode _all, mv(-9=.) //decoding missing values

recode gender (1=1) (2=0), into(female)

drop female

recode gender (1=1) (2=0), gen(female)

label variable female "female dummy variable"

label define femalelab 0 "Male" 1 "Female"

label value female femalelab

drop female

recode gender (1=1 "Female") (2=0 "Male"), into(female)// Single step

tab female gender // tabulates
