Compute Variable

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

Compute Variable

Kam T
Greetings - is it possible to compute a new numeric variable (y) from pre-
existing numeric variable (x) which is coded by a 2-level categorical variable
(n) i.e., y=x(n=1)/x(n=2). I am using SPSS 18, and I suppose I can copy paste
my data into spreadsheet and do this and bring back to SPSS and recode my new
variable. But it would be so much easier to do everything natively in SPSS;
and I'd be surprised if it were not possible! Thanks in advance. Kambiz

=====================
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: Compute Variable

Art Kendall
I am not sure I understand what you are asking.  Many kinds of data transformations can be done in SPSS.

Can you be more explicit in what you are asking?

Art Kendall
Social Research Consultants

On 2/10/2011 2:07 PM, Kam T wrote:
Greetings - is it possible to compute a new numeric variable (y) from pre-
existing numeric variable (x) which is coded by a 2-level categorical variable
(n) i.e., y=x(n=1)/x(n=2). I am using SPSS 18, and I suppose I can copy paste
my data into spreadsheet and do this and bring back to SPSS and recode my new
variable. But it would be so much easier to do everything natively in SPSS;
and I'd be surprised if it were not possible! Thanks in advance. Kambiz

=====================
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
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: Compute Variable

John F Hall
In reply to this post by Kam T
Kam
 
Give more detail.
 
What values does x have now?  What values do you want y to have? 
 
You can probably do something in syntax with COMPUTE, possible followed by RECODE, but we need some sample data (even artificial).
 
There are some syntax based tutorials on my website, which has a search facility.
 
----- Original Message -----
Sent: Thursday, February 10, 2011 8:07 PM
Subject: Compute Variable

Greetings - is it possible to compute a new numeric variable (y) from pre-
existing numeric variable (x) which is coded by a 2-level categorical variable
(n) i.e., y=x(n=1)/x(n=2). I am using SPSS 18, and I suppose I can copy paste
my data into spreadsheet and do this and bring back to SPSS and recode my new
variable. But it would be so much easier to do everything natively in SPSS;
and I'd be surprised if it were not possible! Thanks in advance. Kambiz

=====================
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