Export data to SPSS

Discussions about tools to complement CSPro data processing
Post Reply
seeisol
Posts: 7
Joined: November 20th, 2017, 9:12 am
Location: Maseru

Export data to SPSS

Post by seeisol » December 16th, 2021, 2:01 pm

Dear CSPro Users,

I am trying to export data to SPSS. Everything works fine until I try exporting floating point numbers. The data is exported fine but I do not know if the problem is the SPSS syntax file (.SPS) or what but I get an error as seen on the attached file. Is there something I am doing wrong? This happens only with floating point numbers
Attachments
SPSS Output.JPG
SPSS Error
SPSS Output.JPG (32.08 KiB) Viewed 1703 times
Dictionary.JPG
How data is defined in the dictionary
Dictionary.JPG (27.67 KiB) Viewed 1703 times
Seeiso L.

sherrell
Posts: 212
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

Re: Export data to SPSS

Post by sherrell » December 19th, 2021, 1:18 am

Hi Seeiso,

You can export floating pt #s to SPSS. What version of CSPro are you using and how are you exporting the data?

If you can post your dictionary here and provide at least one case with a floating number I can take a look at it.

Sherrell

jodapecol
Posts: 9
Joined: August 25th, 2017, 9:56 am

Re: Export data to SPSS

Post by jodapecol » December 20th, 2021, 6:13 am

Good day
In the spss syntax you must put for floating points, example: var (dot, 2)

seeisol
Posts: 7
Joined: November 20th, 2017, 9:12 am
Location: Maseru

Re: Export data to SPSS

Post by seeisol » December 20th, 2021, 4:28 pm

Hi Sherrell,

I am using version 7.6.0 (released 31 March 2021).

I have attached my dictionary and sample data file.

Thank you in advance.
Attachments
EndlineSurvey.zip
Dictionary and sample data
(139.31 KiB) Downloaded 40 times
Seeiso L.

seeisol
Posts: 7
Joined: November 20th, 2017, 9:12 am
Location: Maseru

Re: Export data to SPSS

Post by seeisol » December 20th, 2021, 4:33 pm

Hi Jodapecol,

Attached is a screenshot of SPSS syntax generated by CSPro. I never had a problem with it in the past

Regards,
Attachments
SPSS Syntax.JPG
SPSS Syntax
SPSS Syntax.JPG (39.5 KiB) Viewed 1619 times
Seeiso L.

Gregory Martin
Posts: 1608
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Export data to SPSS

Post by Gregory Martin » December 20th, 2021, 5:05 pm

Can you share the export dictionary that is actually causing the problem? Your initial screenshot references F... variables, which aren't in the file you attached.

If the file you previously attached has problems, let us know. I exported the J2... record and read it in via PSPP without issue. I don't have SPSS on my machine, so it's possible that PSPP can read something that SPSS cannot, but I doubt that.

seeisol
Posts: 7
Joined: November 20th, 2017, 9:12 am
Location: Maseru

Re: Export data to SPSS

Post by seeisol » December 21st, 2021, 5:28 pm

Hi Greg,

You are right my initial screenshot references F... variables which are not in the file I shared. The data file was too big so I had to drop some of the variables leaving the relevant ones, but all the floating point variables are giving me the same challenge hence why I shared these ones. I have attached all the files (including the export specifications). J2 does not have any floating point data entered (maybe that is why it can be imported).

Please try exporting J1 and reading it with PSPP.
Attachments
EndlineSurvey.zip
Files
(213.11 KiB) Downloaded 41 times
Seeiso L.

sherrell
Posts: 212
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

Re: Export data to SPSS

Post by sherrell » December 21st, 2021, 6:00 pm

Hi Seeiso,

I just ran it without a hitch. I'm also using PSPP.

If interested, why don't you try this out on the beta 7.7? For beginning with that release, we write files natively.

You can download it here: https://www.csprousers.org/beta/

Launch CSPro, go to the "Tools" menu item and choose DataViewer. Open data.csdb

Under the "Files" menu item you'll see export. Choose SPSS. Let us know if you're still having problems.

I didn't notice earlier you're in Maseru. I worked on the 2004 DHS. Lesotho is a beautiful country!

Sherrell

seeisol
Posts: 7
Joined: November 20th, 2017, 9:12 am
Location: Maseru

Re: Export data to SPSS

Post by seeisol » December 22nd, 2021, 3:46 pm

Hi Sherrell,

Thank you so much. The beta version did the trick.

Yes I am in Maseru. A beautiful country indeed. In 2004 I was still a little boy :lol:
Seeiso L.

sherrell
Posts: 212
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

Re: Export data to SPSS

Post by sherrell » December 22nd, 2021, 7:27 pm

Hi Seeiso,

Great! Glad to hear the beta version worked. There's a lot of new features in v7.7, not all of which are documented, tho they will be when it gets officially released early next year.

Little boy in 2004: :shock:

I was there twice, and during those (month-long) work trips we went Thaba Basiu, Malealea, and Katse Dam, among other places. Very welcome breaks from the work.

Have a good Christmas & New Year's!
Sherrell

Post Reply