STATA PROGRAM USED TO READ RAW BELL CURVE DATA MURRAY POSTED ON THE NET AND TO CREATE VARIABLES
. insheet using all.raw   #NATION.TXT
(50 vars, 12686 obs)

do bell2.do #begin execution

encode race4, gen(race4z) 
encode edsample, gen(edsamplz)
encode adult14b,gen(adlt14bz)
encode adult14s,gen(adlt14sz)
encode ba_atta,gen(ba_attaz)
encode findegre,gen(findgrez)
encode gedvhsgr,gen(gedvhsz)
encode health89,gen(helth89z)
encode lthsval,gen(lthsvalz)
encode lthsvged,gen(lhsvgedz)
encode lthsvhs,gen(lhsvhsz)
encode occ90typ,gen(occtypz)
encode relatt,gen(relattz)
encode sample,gen(samplez)
encode sex,gen(sexz)
encode wed90,gen(wed90z)
encode wedby30,gen(wedb30z)
gen eschl=empschl
recode eschl -99999=0
gen e568=emp568
recode e568 -99999=0
gen unem= unempsam
recode unem -99999=0
gen yrnd=yrrndwr
recode yrnd -99999=0

mvdecode _all, mv (-99999)

gen how_miss=1 if zafqt89!=.&zses!=.&pov89!=.
recode how_miss .=0
label define how 0 "missing" 1 "not missing"
label values how_miss how

gen class=1 if how_miss==1
recode class 1=11 if race4z==4
recode class 1=2 if eschl==1
recode class 11=22 if eschl==1
tab class samplez
gen classify=1 if class==22 & samplez==3
recode classify .=2 if class==22 & samplez==2
tab classify class

aorder _all


drop class race4 edsample adult14b adult14s ba_atta findegre gedvhsgr health89 lthsval lthsvged
drop  lthsvhs occ90typ relatt sample sex wed90 wedby30 empschl emp568
drop unempsam yrrndwr

format zafqt89 zses zage %9.2f


Root Data Subjects Replication & Fit Analyst Documentation

Comparison with posted codebook

STATA output in table/figure order of this website