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
Stata to CSPro
-
Stavros
- Posts: 33
- Joined: February 17th, 2014, 9:12 am
Re: Stata to CSPro
Hi all,
I managed to find a solution for my issue. I imported the data in R and R has an option to export a csv file with fixed column width.
Best,
Stavros
I managed to find a solution for my issue. I imported the data in R and R has an option to export a csv file with fixed column width.
Best,
Stavros
-
Gregory Martin
- Posts: 1947
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: Stata to CSPro
I'm glad that you solved your problem. Also know that you can always create a CSPro file easily if you can get it to Excel format. Here are instructions:
http://www.csprousers.org/help/html/imp ... format.htm
I'm not sure if Stata has an Export to Excel option though.
http://www.csprousers.org/help/html/imp ... format.htm
I'm not sure if Stata has an Export to Excel option though.