04-27-2015 02:07 AM
I am trying to summarise a data and was wondering if both "First Last" statement and Proc Summary would give the same result.
Is there any preference to either in certain special circumstances?
04-27-2015 11:21 AM
It MIGHT give the same result depending on how you code each.
The first/last process is usually when you need to do something special involving the variable(s) involved. Such as select a record, reset a counter, calculate a number of things that may not involve other values of the by variables, or possible create additional records.
If there are many values that need to be kept with those records Summary may not be a good choice as it wants everything on either a Class, Var or ID statements and one or more of those may not be appropriate to get keep those other variables.
Summary and Means are designed to provide summaries not individual records.
04-28-2015 11:05 AM
At this point examples of data and desired output might be needed if you are trying to solve a specific problem. Proc summary or means will not include any value in a summary statistic for missing except the NMISS. With first. and last. processing you could conditionally do something with a missing value.