The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Child Health » SPSS to STATA commands
SPSS to STATA commands [message #20374] Mon, 26 October 2020 12:55 Go to previous message
nessie2020 is currently offline  nessie2020
Messages: 4
Registered: September 2020
Member
Hello!

I have a code from SPSS that I need to recode in Stata. i am having difficulty recoding 4 codes. I have written out my attempt at recreating the code, but I am not getting the same numbers as the original code. Am I missing something? Please let me know. Thank you!

1. CSPLAN ANALYSIS
/PLAN FILE='C:\Users\Maria Teresa\Desktop\articulo DHS\dhs data '+
'set\GU_2014-15_DHS_03212017_1754_47917\muestreo_guatemala.c saplan'
/PLANVARS ANALYSISWEIGHT=WGT
/SRSESTIMATOR TYPE=WR
/PRINT PLAN
/DESIGN STRATA=V022 CLUSTER=V021
/ESTIMATOR TYPE=WR.

Stata code I wrote:
gen stratum = v022
svyset v021 [pw=wgt], strata(stratum)

2. One-way tabulation
CSTABULATE
/PLAN FILE='C:\Users\Maria Teresa\Desktop\articulo DHS\dhs data '+
'set\GU_2014-15_DHS_03212017_1754_47917\muestreo_guatemala.c saplan'
/TABLES VARIABLES=B8_under5
/CELLS POPSIZE TABLEPCT
/STATISTICS SE
/MISSING SCOPE=TABLE CLASSMISSING=EXCLUDE.

Stata code I wrote:
svy:tab b8_under5, count se percent

3. Two-way tabulation
CSTABULATE
/PLAN FILE='C:\Users\HP 2018\Desktop\TRABAJOS\PROYECTOS 2017\articulo DHS\dhs data '+
'set\GU_2014-15_DHS_03212017_1754_47917\gubr71sv\guatemalaoc tubre.csaplan'
/TABLES VARIABLES=HW72_waisting2DS BY full_inmunization
/CELLS POPSIZE COLPCT
/STATISTICS SE
/TEST INDEPENDENCE
/MISSING SCOPE=TABLE CLASSMISSING=EXCLUDE.

My Stata Code:
svy: tabulate hw71_underweight2DS full_immunization, count se

4. Logistic regression
CSLOGISTIC HW71_underweight2DS(LOW) BY full_inmunization
/PLAN FILE='C:\Users\HP 2018\Desktop\TRABAJOS\PROYECTOS 2017\articulo DHS\dhs data '+
'set\GU_2014-15_DHS_03212017_1754_47917\gubr71sv\guatemalaoc tubre.csaplan'
/MODEL full_inmunization
/INTERCEPT INCLUDE=YES SHOW=YES
/STATISTICS CINTERVAL
/TEST TYPE=F PADJUST=LSD
/ODDSRATIOS FACTOR=[full_inmunization(HIGH)]
/MISSING CLASSMISSING=EXCLUDE
/CRITERIA MXITER=100 MXSTEP=5 PCONVERGE=[1e-006 RELATIVE] LCONVERGE=[0] CHKSEP=20 CILEVEL=95
/PRINT SUMMARY VARIABLEINFO SAMPLEINFO.

I don't know what to do here.

 
Read Message
Read Message
Previous Topic: Pooled Analysis
Next Topic: Perinatal Mortality
Goto Forum:
  


Current Time: Mon Dec 30 13:00:59 Coordinated Universal Time 2024