Restructuring SPSS data file

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Restructuring SPSS data file

Miriam Matthews
Hello,

I am trying to restructure an SPSS data file by restructuring selected cases into variables. Each time I go through the procedure using the Restructure function, I received the following error message:

"An invalid index value was detected at case 1. String index values may not be blank. Numeric index values must be non-negative integers. This command is not executed."

I have checked and re-checked the data set. The variables are defined correctly. There are no variables with negative integers, and none of the cells in the data set are blank. I have even deleted every variable except those that are absolutely essential. However, I continue to receive this message.

Does anyone have suggestions for how to address this error message so that the restructure procedure will run?

Thank you!

- Miriam
Reply | Threaded
Open this post in threaded view
|

Re: Restructuring SPSS data file

Maguin, Eugene
Miriam,

This part of your message is curious to me. '... restructuring selected
cases into variables.' Does this mean that you are doing

Select if (x eq 25).
Casestovars ...

OR

Temporary.
Select if (x eq 25).
Casestovars ...

If so, try putting an Execute statement between the Select and the
Casestovars commands. Even though an execute is not supposed to be needed
there, it seems like there are specific instances where an execute is
needed.

Another question i have you is whether there are ANY cases in your original
dataset with blank, negative or sysmis values for the index variable(s). I
see what you say in your message but I just want to ask.

Gene Maguin



Each time I go through the procedure using the Restructure function, I
received the following error message:

"An invalid index value was detected at case 1. String index values may not
be blank. Numeric index values must be non-negative integers. This command
is not executed."

I have checked and re-checked the data set. The variables are defined
correctly. There are no variables with negative integers, and none of the
cells in the data set are blank. I have even deleted every variable except
those that are absolutely essential. However, I continue to receive this
message.

Does anyone have suggestions for how to address this error message so that
the restructure procedure will run?

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Restructuring SPSS data file

parisec-2
Hi all

I found this thread because i have the same question.

sample Original file here.  There are sevearal other variables that have the
exact same values for a SubID so i am putting them all in the /ID sub
command.

<http://spssx-discussion.1045642.n5.nabble.com/file/t47651/samplefile.png>

I've attempted the following:

casestovars
    /ID subID age cat bmi
    /drop a whole lot of variables.

with the goal of having it look like this:
<http://spssx-discussion.1045642.n5.nabble.com/file/t47651/Output.png>


Is the problem that i need a variable that identifies which is the first,
second, 3rd etc repeat for a case?

 "An invalid index value was detected at case 1. String index values may not
be blank. Numeric index values must be non-negative integers. This command
is not executed.

Thanks!
Carol






--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Restructuring SPSS data file

spss.giesel@yahoo.de
Hi,

your command worked for me:

* ----------------------------------------------------------.
DATA LIST FIXED/caseID 1 SubID 3 age 5-9 cat 11 bmi 13-17 Complication 19.
SET DECIMAL = DOT.
BEGIN DATA
1 1 30.89 1 27.96 1
2 2 37.01 1 47.65 2
3 2 37.01 1 47.65 3
4 2 37.01 1 47.65 4
5 3 33.70 1 22.49 1
6 4 36.50 1 40.35 4
7 4 36.50 1 40.35 1
7 5 36.91 0 39.86 2
END DATA.
FORMATS age bmi (F5.2).

casestovars
    /ID subID age cat bmi.

* ----------------------------------------------------------.

There is probably a problem with one of your variables.
Check this advice:

"An invalid index value was detected at case 1. String index values may not
be blank. Numeric index values must be non-negative integers."

Mario Giesel
Munich, Germany




Am Dienstag, 19. Januar 2021, 02:40:10 MEZ hat parisec <[hidden email]> Folgendes geschrieben:


Hi all

I found this thread because i have the same question.

sample Original file here.  There are sevearal other variables that have the
exact same values for a SubID so i am putting them all in the /ID sub
command.

<http://spssx-discussion.1045642.n5.nabble.com/file/t47651/samplefile.png>

I've attempted the following:

casestovars
    /ID subID age cat bmi
    /drop a whole lot of variables.

with the goal of having it look like this:
<http://spssx-discussion.1045642.n5.nabble.com/file/t47651/Output.png>


Is the problem that i need a variable that identifies which is the first,
second, 3rd etc repeat for a case?

"An invalid index value was detected at case 1. String index values may not
be blank. Numeric index values must be non-negative integers. This command
is not executed.

Thanks!
Carol






--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/


=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Restructuring SPSS data file

parisec-2
Thanks much for the prompt reply! I am now going one by one with my variables
on the /ID subcommand to see with one is the problem.





--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD