Using Stata 22 and confident with syntax. However, when I try to use the autorecode function for my ID variables, I get different results from without. In short, my TIMSS dataset has very long ID for students, teachers, classes, schools and countries (to accommodate unique IDs across many waves). Other software I will have to use have a limit on the variable lengths.
AUTORECODE IDCNTRY /INTO CNTRYID.
*The following four lines ensure that the original variables which are only unique per country, become unique in the dataset. Must execute these before the autorecode.
COMPUTE IDSTUD2= CNTRYID*100000000+IDSTUD.
AUTORECODE IDSCHOOL2 /INTO SCHOOLID.
AUTORECODE IDCLASS2 /INTO CLASSID.
AUTORECODE IDSTUD2 /INTO STUDLID.
When I use the two sets of ID variables (IDXXX2 vs. XXXID) in multilevel software (Stata, Mplus and MLwiN) I get an error saying that variables having been created based on a particular set (e.g. average socioeconomic status in IDCLASS2) is not the same as CLASSID. My supervisor says may logic is fine, so I have no idea. I can't even find any descripencies when I inspect random sections of the dataset. Ideas?