fork download
  1. *Maria Ali
  2. *Econ 2301
  3. *14 Nov 2025
  4. use "C:\Users\28020279\Downloads\Exam3\HL.dta"
  5.  
  6. browse
  7. label variable HL16A "COUGH AND FEVER"
  8. label variable HL16B "TB in past"
  9. label variable HL16C "hepatitis in past"
  10. label variable HL4 "Gender"
  11. label define HL4 1"Male" 2"Female"
  12. label value HL4 HL4
  13. label define HL6A 1"Married" 2"Widowed" 3"Divorced" 4"Separated" 5"Never married" 8"DK"
  14. label value HL6A HL6A
  15. replace HL6A=. if HL6A==8 | HL6A==9
  16. count if HL6A==. //62,773
  17. label define ED4A 0"Preschool" 1"Primary" 2"Middle" 3"Matric" 4"Above Matric" 8"DK"
  18. label value ED4A ED4A
  19. replace ED4A=. if ED4A==8|ED4A==9
  20. count if ED4A==. //93,913
  21. label list HH6
  22. count if HH6==2
  23. count if HH6==2&HL6A==3
  24. dis (696/156946)*100
  25. decode HL10A,generate(HL10AS)
  26. tostring HL10B,generate(HL10BS)
  27. gen Literate=1 if (HL10AS=="A"|HL10AS=="B"|HL10AS=="C"|HL10AS=="E"|HL10AS=="X")&(HL10BS=="A"|HL10BS=="B"HL10BS=="C"|HL10BS=="X")
  28. replace Literate=0 if ((HL10AS=="A"|HL10AS=="B"|HL10AS=="C"|HL10AS=="X")|(HL10BS=="A"|HL10BS=="B"HL10BS=="C"|HL10BS=="X"))
  29. label define Literate 1"Literate" 0"Not literate"
  30. label value Literate Literate
  31. drop stratum
  32. drop hhweight
  33. tabstat wscoreu, s(Mean, Max, p95)
  34. tabstat wscorer if HL6<=95
  35. tabstat wscoreu if HL6<=95
  36. dis (.0106651+ .0324211)/2
  37.  
  38.  
Success #stdin #stdout 0.03s 25684KB
stdin
Standard input is empty
stdout
*Maria Ali 
*Econ 2301 
*14 Nov 2025
use "C:\Users\28020279\Downloads\Exam3\HL.dta" 

browse
label variable HL16A "COUGH AND FEVER"
label variable HL16B "TB in past"
label variable HL16C "hepatitis in past"
label variable HL4 "Gender"
label define HL4 1"Male" 2"Female"
label value HL4 HL4
label define HL6A 1"Married" 2"Widowed" 3"Divorced" 4"Separated" 5"Never married" 8"DK"
label value HL6A HL6A
replace HL6A=. if HL6A==8 | HL6A==9
count if HL6A==.  //62,773
label define ED4A 0"Preschool" 1"Primary" 2"Middle" 3"Matric" 4"Above Matric" 8"DK"
label value ED4A ED4A 
replace ED4A=. if ED4A==8|ED4A==9
count if ED4A==. //93,913
label list HH6
count if HH6==2
count if HH6==2&HL6A==3
dis (696/156946)*100
decode HL10A,generate(HL10AS)
tostring HL10B,generate(HL10BS)
gen Literate=1 if (HL10AS=="A"|HL10AS=="B"|HL10AS=="C"|HL10AS=="E"|HL10AS=="X")&(HL10BS=="A"|HL10BS=="B"HL10BS=="C"|HL10BS=="X") 
replace Literate=0 if ((HL10AS=="A"|HL10AS=="B"|HL10AS=="C"|HL10AS=="X")|(HL10BS=="A"|HL10BS=="B"HL10BS=="C"|HL10BS=="X"))
label define Literate 1"Literate" 0"Not literate"
label value Literate Literate
drop stratum
drop hhweight
tabstat wscoreu, s(Mean, Max, p95)
tabstat wscorer if HL6<=95
tabstat wscoreu if HL6<=95
dis (.0106651+ .0324211)/2