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 |
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 ______________________________________________________________________ |
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 |
In reply to this post by Siraj Ur-rehman
Correct solution -- but Execute is not required and will cause an unnecessary extra data pass, which may be a factor for processing time with large data files.
-----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Michael Pearmain Sent: Friday, July 28, 2006 12:18 PM To: [hidden email] Subject: 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 ______________________________________________________________________ |
In reply to this post by Siraj Ur-rehman
Thanks Richard and Michael. Have a nice weekend
Siraj ________________________________ From: SPSSX(r) Discussion on behalf of Oliver, Richard Sent: Fri 7/28/2006 1:27 PM To: [hidden email] Subject: Re: Maximum value of a variable move into a new variable Correct solution -- but Execute is not required and will cause an unnecessary extra data pass, which may be a factor for processing time with large data files. -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Michael Pearmain Sent: Friday, July 28, 2006 12:18 PM To: [hidden email] Subject: 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 ______________________________________________________________________ |
Free forum by Nabble | Edit this page |