Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Processing Grouped Data HRP223 – 2011 November 14 th, 2011 Copyright © 1999-2011 Leland Stanford Junior University. All rights reserved. Warning: This.

Similar presentations


Presentation on theme: "1 Processing Grouped Data HRP223 – 2011 November 14 th, 2011 Copyright © 1999-2011 Leland Stanford Junior University. All rights reserved. Warning: This."— Presentation transcript:

1 1 Processing Grouped Data HRP223 – 2011 November 14 th, 2011 Copyright © 1999-2011 Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and international treaties. Unauthorized reproduction of this presentation, or any portion of it, may result in severe civil and criminal penalties and will be prosecuted to maximum extent possible under the law.

2 2 Analysis Procedures by… You may need to work on groups of subjects (or other things). That is, you want to organize your data by some grouping variable. Most analysis procedures will let you do this easily.

3 3 Means by Group if the data is already sorted (by statement) does not need to be sorted (class statement)

4 4 Summary Statistics

5 5 Complicated Processing by Group Say you want to get the first or last element in a sorted list. – Sort the data if needed. – Include a by THING statement in a data step. – Use the automatically created first.THINGY and/or last.THING variables Automatically make first.act and last.act variables. Set first.act = 1 on first record of an act group of records and last.act = 1 on last record of the groups. 1 = true in a logic check

6 6 Complex Running Totals Say you want to get the average radiation from the first two chest x-rays that a patient receives and the visits are not in order. – Sort the data by patient and date. – In a data step: Set a visit counter to 0 on first visit. Add one for every subsequent visit. Keep the records where visit < 3.

7 7 Many Ways to Sort Choose the Filter and Sort, the Query Builder or the Data > Sort Data… context sensitive menus.

8 8 Once the data is subsetted and ordered, use a data step and process by the subject ID. The PDV does not remember the old values.

9 9


Download ppt "1 Processing Grouped Data HRP223 – 2011 November 14 th, 2011 Copyright © 1999-2011 Leland Stanford Junior University. All rights reserved. Warning: This."

Similar presentations


Ads by Google