Re: Choosing highest value of a variable for each id

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

Re: Choosing highest value of a variable for each id

Jim Marks
Is your data long (3 records with FEV1 for each id)? Please provide sample data.

Jim Marks
Sr. Manager, Market Research
KFHP, MAS
2101 E Jefferson St
Rockville, MD. 20852

> On Nov 27, 2019, at 8:14 AM, Sigrid Vikjord <[hidden email]> wrote:
>
> Caution: This email came from outside Kaiser Permanente. Do not open attachments or click on links if you do not recognize the sender.
>
> ______________________________________________________________________
> Hi,
>
> I have two variables; FEV1 and id. The FEV1 variable is numeric (5.45, 3.28
> etc.) and contains three measurements per id. Does anyone have ideas for a
> syntax that creates a variable "FEV1_best" that contains the highest
> measurement of FEV1 for each id?
>
> I'm using SPSS 25.
>
>
>
>
>
> --
> Sent from: https://urldefense.com/v3/__http://spssx-discussion.1045642.n5.nabble.com/__;!7TrXCGkIugIq!-MOC0JRy3x3gaTQLXx3yj7KhOO4Z2LPhCUWgzrQ8OgKRBS8sdQphBlO_NUMHLOk$
>
> =====================
> 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
NOTICE TO RECIPIENT:  If you are not the intended recipient of this e-mail, you are prohibited from sharing, copying, or otherwise using or disclosing its contents.  If you have received this e-mail in error, please notify the sender immediately by reply e-mail and permanently delete this e-mail and any attachments without reading, forwarding or saving them.  Thank you.

=====================
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: Choosing highest value of a variable for each id

Jon Peck
You can do this with AGGREGATE,


AGGREGATE
  /OUTFILE=* MODE=ADDVARIABLES
  /BREAK=id
  /FEV1_MAX=MAX(FEV1).

On Wed, Nov 27, 2019 at 6:14 AM Sigrid Vikjord <[hidden email]> wrote:
Hi,

I have two variables; FEV1 and id. The FEV1 variable is numeric (5.45, 3.28
etc.) and contains three measurements per id. Does anyone have ideas for a
syntax that creates a variable "FEV1_best" that contains the highest
measurement of FEV1 for each id?

I'm using SPSS 25.





--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

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


--
Jon K Peck
[hidden email]

===================== 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: Choosing highest value of a variable for each id

spss.giesel@yahoo.de
In reply to this post by Jim Marks
Use command AGGREGATE, e.g.

AGGREGATE OUTFILE * MODE = ADDVARIABLES
/BREAK id
/Fev1_best = MAX(Fev1).



Mario Giesel
Munich, Germany


Am Mittwoch, 27. November 2019, 14:40:25 MEZ hat Jim Marks <[hidden email]> Folgendes geschrieben:


Is your data long (3 records with FEV1 for each id)? Please provide sample data.

Jim Marks
Sr. Manager, Market Research
KFHP, MAS
2101 E Jefferson St
Rockville, MD. 20852

> On Nov 27, 2019, at 8:14 AM, Sigrid Vikjord <[hidden email]> wrote:
>
> Caution: This email came from outside Kaiser Permanente. Do not open attachments or click on links if you do not recognize the sender.
>
> ______________________________________________________________________
> Hi,
>
> I have two variables; FEV1 and id. The FEV1 variable is numeric (5.45, 3.28
> etc.) and contains three measurements per id. Does anyone have ideas for a
> syntax that creates a variable "FEV1_best" that contains the highest
> measurement of FEV1 for each id?
>
> I'm using SPSS 25.
>
>
>
>
>
> --
> Sent from: https://urldefense.com/v3/__http://spssx-discussion.1045642.n5.nabble.com/__;!7TrXCGkIugIq!-MOC0JRy3x3gaTQLXx3yj7KhOO4Z2LPhCUWgzrQ8OgKRBS8sdQphBlO_NUMHLOk$
>
> =====================
> 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
NOTICE TO RECIPIENT:  If you are not the intended recipient of this e-mail, you are prohibited from sharing, copying, or otherwise using or disclosing its contents.  If you have received this e-mail in error, please notify the sender immediately by reply e-mail and permanently delete this e-mail and any attachments without reading, forwarding or saving them.  Thank you.


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