Problem with casestovars

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

ana.tourino
Posts: 10
Joined: Fri Dec 06, 2013 10:17 am

Problem with casestovars

Postby ana.tourino » Fri Jan 31, 2014 8:02 pm

Hi all:
I'm runing the casestovars command to restructure my database and It hasn´t worked.
I´m executing this command:
sortcases by country survey party_abbrev.
casestovars
/ID=survey party_abbrev
/INDEX=dimension scale
/GROUPBY=INDEX.

This warning has appeared: “Cases are out of order. The first sequence error was found at case 506. The result data may not be correct.”

Additional information: My original database is like this (but with 15 different countries, 300 different parties, 20 different dimensions and 5 different scales) :
country party_abbrev survey dimension (d) scale (s) mean
Denmark Enh 1 1 1 7,17000
Denmark Enh 1 1 2 2,98913
Denmark Enh 2 1 1 14,40000
Denmark Enh 2 1 2 11,02060
Denmark Enh 2 1 3 9,32292
Denmark Enh 1 2 1 18,71280
Denmark Enh 1 2 2 9,55172
Italy G 1 1 1 10,80000
Italy G 1 1 2 14,08890
Italy G 3 1 1 1,68750
Italy G 3 1 2 9,00000
Italy G 3 1 4 13,53000

I want to create new variables from each combination of dimension and scale for each party and survey. As a result I would obtain a dataset like this:

country party_abbrev survey mean mean mean mean mean mean
(d=1, s=1) (d=1, s=2) (d=1, s=3) (d=2, s=1) (d=2, s=2) (d=1, s=4)

Denmark Enh 1 7,17000 2,98913 18,71280 9,55172
Denmark Enh 2 14,40000 11,02060 9,32292
Italy G 1 10,80000 14,08890
Italy G 3 1,68750 9,00000 13,53000

I understand that the id variables are survey and party_abbrev; and the index variables are dimension and scale. Where is the problem? It maybe the blanks. But I couldn’t understand the warning.
Thanks a lot for your help (and sorry for my English!
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

Re: Problem with casestovars

Postby GerineL » Mon Feb 10, 2014 11:17 am

just look at case 506.
maybe it is that 505 506 507 are all blanks?
Then delete them.
ana.tourino
Posts: 10
Joined: Fri Dec 06, 2013 10:17 am

Re: Problem with casestovars

Postby ana.tourino » Mon Feb 10, 2014 11:48 am

Thank you Gutnre!
Yes, these cases are blanks but I can´t delete them because they have information in other variables.
Even so, the casestovars command ran. Do you think that it could cause any mistake in the transformation?
I've been looking for the new file (transformed) and It seems is well.
Thanks again!
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

Re: Problem with casestovars

Postby GerineL » Mon Feb 10, 2014 12:57 pm

If there are blanks in the ID variables, spss doesn't know these are different cases.
I would create a new variable that has info for all ID vars. Just check the cases in which there were "double" id's (double can also be 2x missing), specifically the case mentioned in the error.

Who is online

Users browsing this forum: No registered users and 1 guest

cron