# Maximum value of a variable move into a new variable

5 messages
Open this post in threaded view
|

## Maximum value of a variable move into a new variable

 Hi Guys I want to calculate a new variable (XYZ) based on the maximum value of (ABC). e.g. if ABC has the maximum value 250 then XYZ has 250 for all observations. Thanks and have a nice weekend. Siraj
Open this post in threaded view
|

## Re: Maximum value of a variable move into a new variable

 Hi Siraj You can use the aggregate command COMPUTE dummy = 1 . EXECUTE . AGGREGATE  /OUTFILE=*  MODE=ADDVARIABLES  /BREAK=dummy  /XYZ = MAX(abc). Mike -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Siraj Ur-rehman Sent: 28 July 2006 17:55 To: [hidden email] Subject: Maximum value of a variable move into a new variable Hi Guys I want to calculate a new variable (XYZ) based on the maximum value of (ABC). e.g. if ABC has the maximum value 250 then XYZ has 250 for all observations. Thanks and have a nice weekend. Siraj ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk________________________________________________________________________ ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email______________________________________________________________________
Open this post in threaded view
|

## Re: Maximum value of a variable move into a new variable

 In reply to this post by Siraj Ur-rehman data list free /abc. begin data 1 3 5 2 4 end data. compute constant=1. AGGREGATE   /OUTFILE=*   MODE=ADDVARIABLES   /BREAK=constant   /xyz = MAX(abc). -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Siraj Ur-rehman Sent: Friday, July 28, 2006 11:55 AM To: [hidden email] Subject: Maximum value of a variable move into a new variable Hi Guys I want to calculate a new variable (XYZ) based on the maximum value of (ABC). e.g. if ABC has the maximum value 250 then XYZ has 250 for all observations. Thanks and have a nice weekend. Siraj