return the higher of 2 values in a new variable

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

return the higher of 2 values in a new variable

Nico Peruzzi
Hi,

I'm trying to create a new variable that has as its value the higher of the
values in 2 other variables.  All is numeric.  Like this (I want to create
"new"):

v1     v2     new
1       2        2
2       3        3
1       1        1
4       3        4

Any tips?

Thanks, Nico

--
Nico Peruzzi, Ph.D.
Reply | Threaded
Open this post in threaded view
|

Re: return the higher of 2 values in a new variable

Melissa Ives
compute new=max(v1,v2).

Melissa

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Nico Peruzzi
Sent: Thursday, November 09, 2006 2:30 PM
To: [hidden email]
Subject: [SPSSX-L] return the higher of 2 values in a new variable

Hi,

I'm trying to create a new variable that has as its value the higher of
the values in 2 other variables.  All is numeric.  Like this (I want to
create
"new"):

v1     v2     new
1       2        2
2       3        3
1       1        1
4       3        4

Any tips?

Thanks, Nico

--
Nico Peruzzi, Ph.D.



PRIVILEGED AND CONFIDENTIAL INFORMATION
This transmittal and any attachments may contain PRIVILEGED AND
CONFIDENTIAL information and is intended only for the use of the
addressee. If you are not the designated recipient, or an employee
or agent authorized to deliver such transmittals to the designated
recipient, you are hereby notified that any dissemination,
copying or publication of this transmittal is strictly prohibited. If
you have received this transmittal in error, please notify us
immediately by replying to the sender and delete this copy from your
system. You may also call us at (309) 827-6026 for assistance.
Reply | Threaded
Open this post in threaded view
|

Re: return the higher of 2 values in a new variable

Nico Peruzzi
perfect - thanks.

On 11/9/06, Melissa Ives <[hidden email]> wrote:

>
> compute new=max(v1,v2).
>
> Melissa
>
> -----Original Message-----
> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
> Nico Peruzzi
> Sent: Thursday, November 09, 2006 2:30 PM
> To: [hidden email]
> Subject: [SPSSX-L] return the higher of 2 values in a new variable
>
> Hi,
>
> I'm trying to create a new variable that has as its value the higher of
> the values in 2 other variables.  All is numeric.  Like this (I want to
> create
> "new"):
>
> v1     v2     new
> 1       2        2
> 2       3        3
> 1       1        1
> 4       3        4
>
> Any tips?
>
> Thanks, Nico
>
> --
> Nico Peruzzi, Ph.D.
>
>
>
> PRIVILEGED AND CONFIDENTIAL INFORMATION
> This transmittal and any attachments may contain PRIVILEGED AND
> CONFIDENTIAL information and is intended only for the use of the
> addressee. If you are not the designated recipient, or an employee
> or agent authorized to deliver such transmittals to the designated
> recipient, you are hereby notified that any dissemination,
> copying or publication of this transmittal is strictly prohibited. If
> you have received this transmittal in error, please notify us
> immediately by replying to the sender and delete this copy from your
> system. You may also call us at (309) 827-6026 for assistance.
>
>
>


--
Nico Peruzzi, Ph.D.