BookmarkSubscribeRSS Feed
RSAOman
Calcite | Level 5

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?

Thanks.

Akshay

3 REPLIES 3
ballardw
Super User

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.

RSAOman
Calcite | Level 5

Can it make a difference what procedure we use if there are blanks (dots) in the number field?

ballardw
Super User

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 820 views
  • 3 likes
  • 2 in conversation