**************************************************** *** Coding of the missing values to stata format *** **************************************************** /* Since 2013 all GLES components use a consistent missing value schema which can be downloaded from our homepage (www.gesis.org/gles). In the SPSS datasets the missing values are coded between -99 to -71. To use also the Stata missing values it is necessary to recode the missing codes to the Stata logic (.a, .b, …) which is done by this do-file. If you have any questions or problems do not hesitate to contact us (gles@gesis.org). GESIS (February 2014) */ **************************************************** set more off *** Set working directory *cd "xxx" *** Load dataset use "ZAxxxx_vx-0-0_en.dta" **************************************************** foreach var of varlist _all { capture confirm numeric var `var' if !_rc { mvdecode `var', mv(-71=.p \-72=.o \-81=.n \-82=.m \-83=.l /// \-84=.k \-85=.j \-86=.i \-92=.h \-93=.g /// \-94=.f \-95=.e \-96=.d \-97=.c \-98=.b /// \-99=.a) local lab: value label `var' if "`lab'"!="" { label define `var' /// .a "no answer" /// .b "don't know" /// .c "not applicable" /// .d "split" /// .e "not participated" /// .f "not in sampling frame" /// .g "not asked, terminated" /// .h "error in data" /// .i "not eligible to vote" /// .j "no vote" /// .k "no cast first/second vote" /// .l "invalid vote" /// .m "no other party" /// .n "do not decide yet" /// .o "no assess" /// .p "haven't heard of term", modify } } }