STATA Sample Code

Set up Log

clear all
capture log close
set more off
log using filename.log, replace
…Program…
log close

Create a tiny database

clear all
g var1=1
forvalues v=1/10 {
set obs `v’
replace var1=_N if var1==.
}
list