Export to SPSS messed up by missing data
Hello folks. I just noticed that when I export to SPSS, things can end up either missing or in the wrong columns when there are empty fields in the .rec file. Here's a simple example I generated to test it. I created a .qes file that looks like this:
{string1} String variable 1 __________ {num1} Numeric variable 1 ## {datevar1} Date variable 1 <yyyy/mm/dd>
{string2} String variable 2 __________ {num2} Numeric variable 2 ## {datevar2} Date variable 2 <yyyy/mm/dd>
{string3} String variable 3 __________ {num3} Numeric variable 3 ## {datevar3} Date variable 3 <yyyy/mm/dd>
-------------------------------
Then I entered a couple rows of data, with complete data on row 1, but incomplete data on row 2 (num1 and datevar 1 were left blank). When I export to Excel, I get the following (which is correct):
STRING1 NUM1 DATEVAR1 STRING2 NUM2 DATEVAR2 STRING3 NUM3 DATEVAR3 record 1.1 1 06/01/2008 record 1.2 2 . rec 1.3 3 06/01/2008 rec 2.1 . . rec 2.2 22 01/01/2008 rec 2.3 23 02/01/2008
But if I export to SPSS, I get this, which is not correct:
STRING1 NUM1 DATEVAR1 STRING2 NUM2 DATEVAR2 STRING3 NUM3 DATEVAR3 record 1.1 1 01/06/2008 record 1.2 2 01/16/2008 rec 1.3 3 01/06/2008 rec 2.1 . . 2201/01/20 8 . 2301/02/20 8 .
My first thought was that SPSS 16 is lousing things up. (I've been forced to upgrade from v15 due to an institutional decision, and I've noticed several other problems with v16). But the same problem occurred when I tried on another machine running SPSS 11.
Has anyone else run into this? I didn't find any mention of it in the archives.
What I'm doing for now to circumvent the problem is this:
1) Exporting to SPSS to get syntax for all the variable and value labels 2) Exporting to Excel to get the data into a format I can read with SPSS 3) Creating syntax to import the Excel file, then adding the variable and value label syntax generated by exporting to SPSS.
It's not terribly more complicated than a straight export to SPSS, but it would be nice if I could do it in one step.
By the way, I'm running EpiData 3.1 on a ThinkPad (XP Professional, SP2, 4 gigs of memory IIRC).
Thanks, Bruce
Hello Bruce,
I had a similar problem, when I exported strings with a length of 80 characters, which is the maximum. The datalist-syntax for spss was wrong and imported only 79 (!) characters, so that the following variables started one column to the left. If the following variable is numeric with the lenght 1, it will be missing.
Regards Juergen
epidata-list@lists.umanitoba.ca schrieb:
Hello folks. I just noticed that when I export to SPSS, things can end up either missing or in the wrong columns when there are empty fields in the .rec file. Here's a simple example I generated to test it. I created a .qes file that looks like this:
{string1} String variable 1 __________ {num1} Numeric variable 1 ## {datevar1} Date variable 1 <yyyy/mm/dd>
{string2} String variable 2 __________ {num2} Numeric variable 2 ## {datevar2} Date variable 2 <yyyy/mm/dd>
{string3} String variable 3 __________ {num3} Numeric variable 3 ## {datevar3} Date variable 3 <yyyy/mm/dd>
Then I entered a couple rows of data, with complete data on row 1, but incomplete data on row 2 (num1 and datevar 1 were left blank). When I export to Excel, I get the following (which is correct):
STRING1 NUM1 DATEVAR1 STRING2 NUM2 DATEVAR2 STRING3 NUM3 DATEVAR3 record 1.1 1 06/01/2008 record 1.2 2 . rec 1.3 3 06/01/2008 rec 2.1 . . rec 2.2 22 01/01/2008 rec 2.3 23 02/01/2008
But if I export to SPSS, I get this, which is not correct:
STRING1 NUM1 DATEVAR1 STRING2 NUM2 DATEVAR2 STRING3 NUM3 DATEVAR3 record 1.1 1 01/06/2008 record 1.2 2 01/16/2008 rec 1.3 3 01/06/2008 rec 2.1 . . 2201/01/20 8 . 2301/02/20 8 .
My first thought was that SPSS 16 is lousing things up. (I've been forced to upgrade from v15 due to an institutional decision, and I've noticed several other problems with v16). But the same problem occurred when I tried on another machine running SPSS 11.
Has anyone else run into this? I didn't find any mention of it in the archives.
What I'm doing for now to circumvent the problem is this:
- Exporting to SPSS to get syntax for all the variable and value labels
- Exporting to Excel to get the data into a format I can read with SPSS
- Creating syntax to import the Excel file, then adding the variable and
value label syntax generated by exporting to SPSS.
It's not terribly more complicated than a straight export to SPSS, but it would be nice if I could do it in one step.
By the way, I'm running EpiData 3.1 on a ThinkPad (XP Professional, SP2, 4 gigs of memory IIRC).
Thanks, Bruce
participants (1)
-
epidata-list@lists.umanitoba.ca