Hi Behkami,

 

I am not sure if someone had answered you on converting a set of string variables into numeric question part.

 

Assuming that your data is as follows.

 

1st scenario:

 

 v1 v2 v3 v4 

 1   1   1  1 

 1   1   1  1 

 1   1   1  1 

 1   1   1  1  

 

Then the syntax to convert the string numbers, v1 v2 v3 v4, into numerical variables will be as follows:

 

do repeat x1=n1 to n4

/x2=v1 to v4.

 

compute x1=number(x2,f8).

 

end repeat.

exe.

 

The f8 in function of the compute reads the number of string values you want to convert from the original string variables.

 

 

2nd scenario:

 

 v1 v2 v3 v4 

 a   a   a  a 

 a   a   a  a 

 a   a   a  a 

 a   a   a  a 

 

 

recode v1 ('a'=1) into n1.

crosstab v1 by n1.

 

You will have to do it one by one by doing a copy and paste of the above syntax for v2 to v4. This is because it is always a good habit to check your recode to see if you have recoded all the values from your original variable.

 

Warmest Regards

Dorraj Oet


>
>
> behkami wrote:
> >
> > My Excel file (xlsx) contains more than 1200 columns. I tried to open it
> > using the SPSS version 17.01 but the following error came up: "Error
> > Starting the Java Virtual Machine; unable to open file; "FILE NAME"".
> > I had no choice but copy/paste all the data from Excel into SPSS. But when
> > I do it, all the variables are changed into string (on variables page).
> > Is there a way to convert multiple string variables into numeric using a
> > single command?

> > Any suggestions would be highly appreciated.
> >
> > Behkami M.D
> > PhD student in Immunology
> >
>
>
> --
> View this message in context: http://spssx-discussion.1045642.n5.nabble.com/How-to-convert-multiple-string-varibles-into-numeric-in-SPSS-tp4574076p4580036.html
> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> LISTSERV@LISTSERV.UGA.EDU (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