Stata to CSPro
Posted: October 15th, 2014, 10:47 am
Hi all,
I have a question for you; has anyone tried to create a lookup file from a Stata dataset?
To be more specific, I am taking part in survey where the data entry was done with CSPro, the data then were exported to Stata where the cleaning was done. Now for the follow-up of the survey some variables of the cleaned data are going to be used, mainly variables like Household Id, Name, Gender, Age etc. There is an option in Stata to export a dataset in a comma separated format (so I can use this as a Lookup File) but when I tried that the variables do not have a fixed length (as already set from CSPro) causing a big issue when it comes to creating the dictionary so it can match the lookup file. What I mean with fixed length, while in CSPro name variable is set to have 30 characters length, so even if a name has 10 characters it would be followed by 20 empty spaces and then the next variable would follow. In my case (exporting from Stata) this is not happening, a name with 10 characters or 6, does not follow the 30 char. length.
I hope that I managed to describe the issue I am facing and I am also pretty sure that this a Stata's fault so it maybe not the right forum to ask but maybe someone knows something!
Thanks in advance,
Stavros
I have a question for you; has anyone tried to create a lookup file from a Stata dataset?
To be more specific, I am taking part in survey where the data entry was done with CSPro, the data then were exported to Stata where the cleaning was done. Now for the follow-up of the survey some variables of the cleaned data are going to be used, mainly variables like Household Id, Name, Gender, Age etc. There is an option in Stata to export a dataset in a comma separated format (so I can use this as a Lookup File) but when I tried that the variables do not have a fixed length (as already set from CSPro) causing a big issue when it comes to creating the dictionary so it can match the lookup file. What I mean with fixed length, while in CSPro name variable is set to have 30 characters length, so even if a name has 10 characters it would be followed by 20 empty spaces and then the next variable would follow. In my case (exporting from Stata) this is not happening, a name with 10 characters or 6, does not follow the 30 char. length.
I hope that I managed to describe the issue I am facing and I am also pretty sure that this a Stata's fault so it maybe not the right forum to ask but maybe someone knows something!
Thanks in advance,
Stavros