Re: Create new variable with values that are 1 less than values of existing variable

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: Create new variable with values that are 1 less than values of existing variable

Edward Boadi
This Works :

DATA LIST list / q66(f2.0) q67(f2.0) q68(f2.0).
BEGIN DATA
66 67 68
END DATA.

compute q66Fixed = q66-1.
compute q67Fixed = q67-1.
compute q68Fixed = q68-1.
execute.
LIST.

**Out Put********** .
66 q67 q68 q66Fixed q67Fixed q68Fixed

 66  67  68    65.00    66.00    67.00

Number of cases read:  1    Number of cases listed:  1

Edward.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]]On Behalf Of
Jim Moffitt
Sent: Friday, June 30, 2006 11:25 AM
To: [hidden email]
Subject: Create new variable with values that are 1 less than values of
existing variable


I've run the following syntax only to get the same values in my "fixed"
variables as in the original variables?
compute q66Fixed = q66-1.

compute q67Fixed = q67-1.

compute q68Fixed = q68-1.

execute.

What am I doing wrong?
Thanks for your help.