Larry Larusso

222017
 

Editor's note: The following post is from Scott Leslie, PhD, Manager of Advanced Analytics for MedImpact Healthcare Systems, Inc. Scott will be one of the Code Doctors at SAS Global Forum 2017.

Learn more about Scott.

VISIT THE CODE CLINIC AT SASGF 2017

$0 copay, no deductible.  No waiting rooms, no outdated magazines. What kind of doctor’s office is this? While we might not be able to help with that nasty cough, SAS Code Doctors are here to help – when it comes to your SAS code, that is.

Yes, the Code Doctors return to SAS Global Forum 2017! This year the Code Clinic will have over 20 SAS experts on-call to answer your questions on syntax, SAS Solutions, best practices and concepts across a broad range of SAS topics/applications, including Base SAS, macros, report writing, ODS, SQL, SAS Enterprise Guide, statistics, and more. It’s a fantastic opportunity to review code, ask questions, develop and brainstorm with peers who have decades of experience using SAS. Bring your code on paper, a flash drive, or a laptop. We’ll have 3-4 laptops with several versions of SAS software installed: 9.1.3 to 9.4 and EG 4.1 to 7.1. And if we can’t answer your coding question at the clinic, we can easily refer you to a specialist, namely the SAS R&D section of the Quad.

So, take advantage of this personalized learning experience in the Lower Quad area of the conference. Clinic office hours are:

  • Monday 4/3, 10:00 am - 3:30 pm
  • Tuesday 4/3, 9:30 am – 2:00 pm and 3:30 pm – 6:00 pm

Here’s the detailed schedule of our all-star code doctor lineup. If you haven’t heard of these names yet, you have now...

/*Just by reading this blog…*/.

 

About Scott Leslie

Scott Leslie, PhD, is Manager of Advanced Analytics for MedImpact Healthcare Systems, Inc. with over15 years of SAS® experience in the pharmacy benefits and medical management field. His SAS knowledge areas include SAS/STAT, Enterprise Guide, and Visual Analytics. Scott presents at local, regional and international SAS user group conferences as well at various clinical and scientific conferences. He is a former executive committee member of the Western Users of SAS Software (WUSS) and contributes to the San Diego SAS Users’ Group (SANDS).

Visit the code clinic at SAS Global Forum was published on SAS Users.

092017
 

Editor’s note: This is the first in a series of posts to help current SAS programmers add SAS Viya to their analytics skillset. In this post, SAS instructors Stacey Syphus and Marc Huber introduce you to the new Transitioning from Programming in SAS 9 to SAS Viya video library, designed to show SAS programmers [...]

The post Transitioning from programming in SAS 9 to SAS Viya appeared first on SAS Learning Post.

032017
 

Editor's note: The following post is from Emma Warrillow, Chief DiGGer at Data Insight Group Inc. (DiG). Emma is a featured speaker at SAS Global Forum 2017 and recently named as one of the Top Women in Direct Marketing by Direct Marketing News. Learn more about Emma.   “I need [...]

The post That analyst is certifiable! appeared first on SAS Learning Post.

282017
 

Did you know that… Scientists have concluded that the chicken came first, not the egg, because the protein which makes the egg shells is only produced by hens. Source A toaster uses almost half as much energy as a full-sized oven. Source The London Eye in England is the largest [...]

The post Are you learning what future employers are really looking for? appeared first on SAS Analytics U Blog.

142017
 

Editor's note: This following post is from Shara Evans, CEO of Market Clarity Pty Ltd. Shara is a featured speaker at SAS Global Forum 2017 and a globally acknowledged Keynote Speaker and widely regarded as one of the world’s Top Female Futurists.

Learn more about Shara.


In the movie Minority Report lead character John Anderton, played by Tom Cruise, has an eye transplant in order to avoid being recognized by ubiquitous iris scanning identification systems.

Such surgical procedures still face some fairly significant challenges, in particular connecting the optic nerve of the transplanted eye to that of the recipient. However the concept of pervasive individual identification systems is now very close to reality and although the surgical solution is already available, it’s seriously drastic!

We’re talking face recognition here.

Many facial recognition systems are built on the concept of “cooperative systems,” where you look directly at the camera from a pre-determined distance and you are well lit, and your photo is compared against a verified image stored in a database. This type of system is used extensively for border control and physical security systems.

Facial recognition

Face in the Crowd Recognition (Crowd walking towards camera in corridor) Source: Imagus

Where it gets really interesting is with “non-cooperative systems,” which aim to recognize faces in a crowd: in non-optimal lighting situations and from a variety of angles. These systems aim to recognize people who could be wearing spectacles, scarves or hats, and who might be on the move. An Australian company, Imagus Technology has designed a system that is capable of doing just that — recognizing faces in a crowd.

To do this, the facial recognition system compiles a statistical model of a face by looking at low-frequency textures such as bone structure. While some systems may use very high-frequency features such as moles on the skin, eyelashes, wrinkles, or crow’s feet at the edges of the eyes — this requires a very high-quality image. Whereas, with people walking past, there’s motion blur, non-optimal camera angles, etcetera, so in this case using low-frequency information gets very good matches.

Biometrics are also gaining rapid acceptance for both convenience and fraud prevention in payment systems. The two most popular biometric markers are fingerprints and facial recognition, and are generally deployed as part of a two-factor authentication system. For example, MasterCard’s “Selfie Pay” app was launched in Europe in late 2016, and is now being rolled out to other global locations. This application was designed to speed-up and secure online purchases.

Facial recognition is particularly interesting, because while not every mobile phone in the world will be equipped with a fingerprint reader, virtually every device has a camera on it. We’re all suffering from password overload, and biometrics - if properly secured, and rolled out as part of a multi-factor authentication process - can provide a solution to coming up with, and remembering, complex passwords for the many apps and websites that we frequent.

Its not just about recognizing individuals

Facial recognition systems are also being used for marketing and demographics. In a store, for example, you might want to count the number of people looking at your billboard or your display. You'd like to see a breakdown of how many males and females there are, age demographics, time spent in front of the ad, and other relevant parameters.

Can you imagine a digital advertising sign equipped with facial recognition? In Australia, Digital Out-of-Home (DOOH) devices are already being used to choose the right time to display a client’s advertising. To minimize wastage in ad spend, ads are displayed only to a relevant audience demographic; for instance, playing an ad for a family pie only when it sees a mum approaching.

What if you could go beyond recognizing demographics to analyzing people’s emotions? Advances in artificial intelligence are turning this science fiction concept into reality. Robots such as “Pepper” are equipped with specialized emotion recognition software that allows it to adapt to human emotions. Again, in an advertising context, this could prove to be marketing gold.

Privacy Considerations

Of course new technologies is always a double-edged sword, and biometrics and advanced emotion detection certainly fall into this category.

For example, customers typically register for a biometric payment system in order to realize a benefit such as faster or more secure e-commerce checkouts or being fast-tracked through security checks at airports. However, the enterprise collecting and using this data must in turn satisfy the customer that their biometric reference data will be kept and managed securely, and used only for the stated purpose.

The advent of advanced facial recognition technologies provides new mechanisms for retailers and enterprises to identify customers, for example from CCTV cameras as they enter shops or as they view public advertising displays. It is when these activities are performed without the individual’s knowledge or consent that concerns arise.

Perhaps most worrisome is that emotion recognition technology would be impossible to control. For example, anyone would be able to take footage of world leaders fronting the press in apparent agreement after the outcome of major negotiations and perhaps reveal their real emotions!

From a truth perspective, maybe this would be a good thing.

But, imagine that you’re involved in intense business negotiations. In the not too distant future advanced augmented reality glasses or contacts could be used to record and analyze the emotions of everyone in the room in real time. Or, maybe you’re having a heart-to-heart talk with a family member or friend. Is there such a thing as too much information?

Most of the technology for widespread exploitation of face recognition is already in place: pervasive security cameras connected over broadband networks to vast resources of cloud computing power. The only piece missing is the software. Once that becomes reliable and readily available, hiding in plain sight will no longer be an option.

Find out more at the SAS Global User Forum

This is a preview of some of the concepts that Shara will explore in her speech on “Emerging Technologies: New Data Sets to Interpret and Monetize” at the SAS Global User Forum:

  • Emerging technologies such as advanced wearables, augmented and virtual reality, and biometrics — all of which will generate massive amounts of data.
  • Smart Cities — Bringing infrastructure to life with sensors, IoT connections and robots
  • Self Driving Cars + Cars of the Future — Exploring the latest in automotive technologies, robot vision, vehicle sensors, V2V comms + more
  • The Drone Revolution — looking at both the incredible benefits and challenges we face as drones take to the skies with high definition cameras and sensors.
  • The Next Wave of Big Data — How AI will transform information silos, perform advanced voice recognition, facial recognition and emotion detection
  • A Look Into the Future — How the convergence of biotech, ICT, nanotechnologies and augmentation of our bodies may change what it means to be human.

Join Shara for a ride into the future where humans are increasingly integrated with the ‘net!

About Shara Evans

Technology Futurist Shara Evans is a globally acknowledged Keynote Speaker and widely regarded as one of the world’s Top Female Futurists. Highly sought after and in demand by conference producers and media, Shara provides the latest insights and thought provoking ideas on a broad spectrum of issues. Shara can be reached via her website: www.sharaevans.com

(Note: My new website will be launching in a few weeks. In the meantime, the URL automatically redirects to my company website – www.marketclarity.com.au )

tags: analytics, SAS Global Forum

Facial recognition: Monetizing faces in the crowd was published on SAS Users.

212017
 

zhangEditor's note: This following post is from Xiaoyuan Zhang, presenter at an upcoming Insurance and Finance User Group (IFSUG) webinar.

Learn more about Xiaoyuan Zhang.


As a business user with limited statistical skills, I don’t think I could build a credit scorecard without the help of SAS Enterprise Miner. As you can see from the flow chart, SAS Enterprise Miner, a descriptive and predictive modeling software, does an amazing job in model developing and streamlining.

credit_score_modeling-in-sas-enterprise-minerThe flow chart presents my whole credit score modeling process, which is divided into three parts: creating the preliminary scorecard, performing reject inference, and building the final scorecard. I will cover the whole process in the Insurance and Finance Users Group (IFSUG) virtual session on Feb 3, 2017. In this blog I wanted to emphasize the second part, which is sometimes easy to ignore.

The data for preliminary scorecard is from only accepted loan applications. However, the scorecard modeler needs to apply the scorecard to all applicants, both accepted and rejected. To solve the sample bias problem reject inference is performed.

Before inferring the behavior (good or bad) of the rejected applicants, data examination is needed. I used StatExplore node to explore the data and found out that there were a significant number of missing values, which is problematic. Because in SAS Enterprise Miner regression model, the model that is used here for scorecard creation and reject inference, ignores observations that contain missing values, which reduces the size of the training data set. Less training data can substantially weaken the predictive power of the model.

To help with this problem, Impute Node is used to impute the missing values. In the Properties Panel of the node, there are a variety of choices from which the modeler could choose for the imputation. In this model, Tree surrogate is selected for class variables and Median is selected for interval variables.

However, in Impute Node data role is set as Train. In order to use the data in Reject Inference Node, data role needs to be changed into Score. A SAS Code node is put in between for this purpose, which writes as:

data &em_export_score;
      set &em_import_data;   
   run;

Last but not least, Reject Inference Node is used to infer the performance of the rejected loan applicant data. SAS Enterprise Miner offers three standard, industry-accepted methods for inferring the performance of the rejected applicant data by the use of a model that is built on the accepted applicants. We won’t explore the three methods in detail here, as the emphasis of the blog is on the process.

To hear more on this topic, please register for the IFSUG virtual session, Credit Score Modeling in SAS Enterprise Miner on February 3rd from 11am-12pm ET.


About Xiaoyuan Zhang

Xiaoyuan Zhang grew up in Zhaoyuan China on the coast of the Bohai sea. Her town is famous for its ancient gold mine, hot springs and its unusual and tasty seafood. Her undergraduate degree is from China Agricultural University in Bejing, where she majored in Marketing Intelligence and graduated with honors. She graduated, with honors, from Drexel University with a Master Degree in Finance. She has passed two CFA exams and learned Enterprise Miner in one of her courses. She specializes in efficient credit score modeling with unutilized SAS Enterprise Minor. She is using some of her post-graduation free time to study "regular SAS", to tutor and to volunteer.

 

tags: IFSUG, SAS Enterprise Miner

Credit score modeling in SAS Enterprise Miner: Reject inference to solve sample bias problem was published on SAS Users.

122017
 

Yawn. Stretch. Blink. Blink again. It is 8:00 on the first day of the semester, and you know you haven’t had enough sleep (or coffee), but did the professor really just say that we are going to learn statistics? Why did I sign up for this class again? While that […]

The post Resources to prepare the next generation of SAS professionals appeared first on SAS Analytics U Blog.

062017
 

Regardless of how long they’ve used the software, there’s no better event for SAS professionals then SAS Global Forum. The event will attract thousands of users from across the globe and is an excellent place to network with and learn from users of all skill levels. To help those relatively new users of SAS experience the conference for the first time, the conference offers the Junior Professional Award program.

The program is designed exclusively for full-time SAS professionals who have used SAS on the job for three years or less, have never attended SAS Global Forum, and whose circumstances would otherwise keep them from attending. But, don’t let the word “junior” confuse you. All “new” SAS professionals regardless of age are eligible.

The Junior Professional award provides user with a waived conference registration fee, including conference meals, a free pre-conference tutorial, and great opportunities to learn from and network in a large community of SAS users. The program does not cover other costs associated with attending the event (travel and lodging are not included for example).

To apply, users need to submit fill out the online application form. Award applications must be received by January 16, 2017. Questions can be directed to the Junior Professional Program Coordinator, whose contact information can be found on the website.

To learn more about the award and its benefits, I recently sat down with one of the 2015 winners, Shavonne Standifer.


junior-professional-program

Shavonne Standifer, 2015 SAS Global Forum Junior Professional Award winner

Larry LaRusso: Hello Shavonne. First of all, let me congratulate you on winning a past award. That’s a great accomplishment, for sure. So tell me, how did you first learn about the program?
Shavonne Standifer: Interestingly, I wasn’t looking specifically for the award and didn’t even really know it existed. I was searching for a SAS proceeding paper and somehow stumbled across the application. I just applied, and got it!

LL:  That’s awesome. What made you want to attend SAS Global Forum?
SS: I knew a little bit about the event and really wanted to attend so that I could take advantage of the hands-on learning opportunities. I also thought it would be super cool if I could attend the lectures of my favorite SAS authors, and I knew many of them planned to present.

LL: What were your first impressions of the event?
SS: I was amazed by how many people were there. I was also amazed by how nice and helpful everyone was. I met so many new friends.

LL: What was the best part of your Global Forum experience?
SS: The best part of my experience by far was when I met John Amrhein. We met during a networking event in the Quad. After subjecting him to a 2-minute rant about how much I loved SAS software, and all of the reasons why, he finally had a minute to introduce himself and mentioned that he was the 2017 global forum conference chair. I was completely shocked! To my complete surprise, he encouraged me to be a part of his team, to which I later applied and was accepted.

LL: What are doing now? Are you using SAS?
SS: I currently use SAS software to provide data and statistical analysis that support the strategic business objectives of my organization. I am also a member of the conference planning team where I assist with the selection and delivery of Global Forum papers and volunteer coordination. Having the opportunity to be a part of this team has helped to increase my knowledge of SAS technologies and business trends. It’s been an incredible experience.

LL: How were you able to apply the knowledge you gained from the experience to what you’re doing now?
SS: Most definitely. I’ve used the learning from a tutorial Art Carpenter presented on Innovative SAS Techniques to help me utilize SAS more efficiently for data cleaning, scrubbing, and reshaping big datasets. The knowledge I gained has really helped improve project turnaround and provide more meaningful insights.

LL: Are you planning to attend SAS Global Forum again?
SS: Absolutely! In fact, I have returned every year since winning that award and plan to for many years to come. It’s just a great place to learn from and network with fellow SAS users.

LL: Any other comments you’d like to share about the award?
SS: I would encourage anyone who is eligible to consider applying for the award. I remember sitting in front of my laptop, hopeful, but thinking that I had a 1 in a million chance of being selected for the award. I decided to give it a try and it has changed my life! So much awesomeness has occurred in both my professional and personal life as a direct result of receiving the award. Professionally, the advice and mentorship from expert SAS users has helped me mature my SAS programming talents. Personally, the fellow JPP awardees that I’ve met along the way has provided an extended community of users whom I can call or email to ask advice. We keep in contact and support one another as needed, these relationships are invaluable. If you are eligible, Apply! It’s a great opportunity!

LL: Thanks Shavonne. Sounds like it was an awesome experience and I really enjoyed our time together.

tags: Junior Professional Program, SAS Global Forum

Junior Professional Program helps new users attend SAS Global Forum 2017 was published on SAS Users.

十二 222016
 

melissa_marshallEditor's note: This following post is from Melissa Marshall, Principal at Melissa Marshall Consulting LLC. Melissa is a featured speaker at SAS Global Forum 2017, and on a mission to transform how scientists and technical professionals present their work.  

Learn more about Melissa.


Think back to the last technical talk you were an audience member for. What did you think about that talk? Was it engaging and interesting? Boring and overwhelming?  Perhaps it was a topic that was important to you, but it was presented in a way that made it difficult to engage with the content. As an expert in scientific presentations, I often observe a significant “disconnect” between the way a speaker crafts a presentation and the needs of the audience. It is my belief that the way to bridge this gap is for you, as a technical presenter, to become an audience centered speaker vs. a speaker centered speaker.

transform-your-technical-talks01

Here I will provide some quick tips on how to transform your content and slides using your new audience centered speaking approach!

Audience Centered vs. Speaker Centered

The default setting for most presenters is that they are speaker centered—meaning that they make choices in their presentation because it is what works primarily for themselves as a speaker. Examples include: spending a lot of time speaking about an area of the topic that gave you the most difficulty or that you spent the most amount of time working on or using terms that are familiar to you but are jargon for the audience, putting most of the words you want to say on your slides to remind you what to say during the talk so your slides are basically your speaker notes, and standing behind a podium and disconnecting yourself physically from your audience. These choices are common in presentations, but they do not set you up for success. It is a key reason why many presentations of technical information fail.

A critical insight is to realize that your success as a speaker depends entirely upon your ability to make your audience successful.  You don’t get to decide that you gave a great talk (even if no one understood it)!  That’s because presentations, by their very nature, are always made for an audience.  You need something from your audience—that is why you are giving a talk!  So, it is time to get serious about making your audience successful (so you can be too!).  I might define “audience success” as: your audience understands and views your subject in the way you wanted them to.  Strategically, if you desire to be a successful speaker, then the best thing you do is go “all in” on making your audience successful!

Audience Centered Content

To make your content more audience centered, you can ask yourself 4 critical questions ahead of time about your audience:

  • Who are they?
  • What do they know?
  • Why are they here?
  • What biases do they have?

transform-your-technical-talks02

The answers to these questions will guide how you begin to focus your content. Additionally, as a presenter of technical information, one of the most important questions you need to answer along the way, at many stages in your presentation, is “So what?”.  Too often presenters share complex technical information or findings, but they do not make the direct connection to the audience of how that information is relevant or important to the big picture or overall message.  Remind yourself each time you share a technical finding to also follow up that information with the answer to the question “So what?”.  This will make your content immediately more engaging and relevant to your audience.

transform-your-technical-talks03

Audience Centered Slide Design

Think about the last several presentations that you sat through as an audience member.  How would you describe the slides?  Text heavy? Cluttered? No clear message? Full of bulleted lists?  Audiences consistently complain of “Death by PowerPoint”, which refers to the endless march of speakers through text filled slide after text filled slide.  The reason this is so detrimental to audiences is that our brains have a limited “bandwidth” for verbal information.  When we reach that limit, it’s called cognitive overload and our brains stop processing the information as effectively and efficiently.  When you have a speaker talking (the speaker’s words are verbal information) and then you have slides to read with lots of words on them (also more verbal information), you are at a high risk of cognitive overload for the audience.  Therefore, many audiences “tune out” during presentations or report feeling exhausted after a day of listening to presentations.  This is a result of cognitive overload.  A more effective way to approach slides for your audience is to think about making your slides do something for you that your words cannot. You are giving a talk, so the words part is mostly covered by what you are saying…it is much more powerful to make your slides primarily visual so that they convey information in a more memorable, engaging, and understandable way. This is known in the field of cognitive research as the Picture Superiority Effect.  John Medina’s excellent book Brain Rules states that “Based on research into the Picture Superiority Effect, when we read text alone, we are likely to remember only 10 percent of the information 3 days later. If that information is presented to us as text combined with a relevant image, we are likely to remember 65 percent of the information 3 days later.” 

A great a slide design strategy that I advocate for is called the assertion-evidence design.  This slide design strategy is based in research (including Medina’s mentioned above) and works beautifully for presentations of technical information. The assertion-evidence slide design is characterized by a concise, complete sentence headline (no longer than 2 lines) that states the main assertion (i.e. what you want the audience to know) of the slide. The body of the slide then consists of visual evidence for that take away message (charts, graphs, images, equations, etc.). Here is an example of a traditional slide transformed to an assertion-evidence slide:

transform-your-technical-talks04

transform-your-technical-talks05

Having trouble banishing bullet lists? One of my favorite quick (and free!) tools for getting yourself past bulleted lists is Nancy Duarte’s Diagrammer tool.  I like this tool because it asks you what is the relationship between the information that you are trying to show and creates a graphic to show that relationship.  Remember: the best presentations use a variety of visual evidence!  Charts, graphs, pictures, videos, diagrams, etc.  Give your audience lots of visual ways to connect with your content!

Final Thoughts

Next time you present, I encourage you to let every decision you make along the way be guided first by the needs of your audience.  Remember, the success of your audience in understanding your work is how your success as a speaker is measured! For more tips on technical talks, check out my TED Talk entitled “Talk Nerdy To Me.” For questions, comments, or to book a technical presentations workshop at your company or institution, please contact me at melissa@presentyourscience.com.

About Melissa Marshall

melissa_marshallMelissa Marshall is on a mission: to transform how scientists and technical professionals present their work. That’s because she believes that even the best science is destined to remain undiscovered unless it’s presented in a clear and compelling way that sparks innovation and drives adoption.

For almost a decade, she’s traveled around the world to work with Fortune 100 corporations, institutions and universities, teaching the proven strategies she’s mastered through her consulting work and during her 10 years as a faculty member at Penn State University.

When you work with Melissa, you will get the practical skills and the natural confidence you need to immediately shift your “information dump”-style presentations into ones that are meaningful, engaging, and inspire people to take action. And the benefits go far beyond any single presentation; working with Melissa, your entire organization will develop a culture of successful communication, one that will help you launch products and ideas more effectively than ever before.

Melissa is also a dynamic speaker who has lectured at Harvard Medical School, the New York Academy of Sciences, and the Centers for Disease Control and Prevention (CDC). For a sneak peek, check out her TED talk, “Talk Nerdy to Me.” It’s been watched by over 1.5 million people (and counting).

Visit Melissa and learn more at www.PresentYourScience.com.

Melissa can be reached at melissa@presentyourscience.com.

tags: papers & presentations, SAS Global Forum

Transform your technical talks with an audience centered approach was published on SAS Users.

十二 172016
 

A multilabel format enables you to assign multiple labels to a value or a range of values. The capability to add multilabel formats was added to the FORMAT procedure in SAS® 8.2.  You assign multiple labels by specifying the MULTILABEL option in the VALUE statement of PROC FORMAT. For example, specifying the MULTILABEL option in the following VALUE statement enables the Agef format to have overlapping ranges.

value agef (multilabel)
11='11'
12='12'
13='13'
11-13='11-13';

Multilabel formats are available for use only in the MEANS, SUMMARY, TABULATE, and REPORT procedures. The code examples that follow show the creation of a simple mutlilabel format (using PROC FORMAT) and its use in each of these procedures.

First, a PROC FORMAT step creates a multilabel format for the Agef variable in the Sashelp.Class data set, along with a character format for the Sex variable. The NOTSORTED option is specified to indicate the preferred order of the ranges in the results.

proc format library=work;
value agef (multilabel notsorted)
11='11'
12='12'
13='13'
11-13='11-13'
14='14'
15='15'
16='16'
14-16='14-16';
value $sexf
'F'='Female'
'M'='Male';
run;

Now, the multilabel format is used in the other SAS procedures that are mentioned earlier. In PROC MEANS and PROC TABULATE, the MLF option must be specified in the CLASS statement for the Age variable. In PROC REPORT, the MLF option is specified in the DEFINE statement for Age. The PRELOADFMT and ORDER=DATA options are also specified to preserve the order as defined in the format. The PRELOADFMT option applies only to group and across variables in PROC REPORT.

proc tabulate data=sashelp.class format=8.1;
class age / mlf preloadfmt order=data;
class sex;
var height;
table age, sex*height*mean;
format age agef. sex $sexf.
title 'PROC TABULATE';
run;
proc means data=sashelp.class nway Mean nonobs maxdec=1 completetypes;
class age / mlf preloadfmt order=data;
class sex;
var height;
format age agef. sex $sexf.;
title 'PROC MEANS';
run;
 
proc report data=sashelp.class NOWD headline completerows;
col age sex height;
define age / group mlf preloadfmt order=data format=agef.;
define sex / group format=$sexf.;
define height / mean format=8.1;
break after age / skip;
title 'PROC REPORT';
run;

The output from each of these procedures is shown below.

creating-and-using-multilabel-formats01creating-and-using-multilabel-formats02creating-and-using-multilabel-formats03

You can use a multilabel format to facilitate the calculation of moving averages, as illustrated in the next example. This example creates a multilabel format using the CNTLIN= option in PROC FORMAT. Then, that format is used to calculate a three-month moving average in PROC SUMMARY.

data sample;  /*  Create the sample data set. */
do sasdate='01JAN2015'D to '31DEC2016'D;
x=ranuni(sasdate)*1234;
if day(sasdate)=1 then output;
end;
run;
 
proc print data=sample;
format sasdate date9.;
title 'Sample data set';
run;
 
data crfmt;  /* Create a CNTLIN data set for a multilabel format. */
keep fmtname start end label HLO;
begin='01JAN2015'D;
final='31DEC2016'D;
fmtname='my3month';
periods=intck('month',begin,final) -2;
do i=0 to periods;
end=intnx('month',final,-i,'E');
start=intnx('month',end,-2);
label=catx('-',put(start,date9.),put(end,date9.));
HLO='M';  /* M indicates "multilabel."  */
output;
end;
run;
 
proc print data=crfmt;
var fmtname start end label HLO;
format start end date9.;
title 'CNTLIN data set';
run;
 
/*  Use the CNTLIN= option to create the format.  */
proc format library=work cntlin=crfmt fmtlib;
select my3month;
title 'FMTLIB results for my3month format';
run;
 
proc summary data=sample NWAY order=data;
class sasdate / MLF;   /*  Use the MLF option.  */
var x;
output out=final (drop=_: ) mean= / autoname;
format sasdate my3month.;
run;
 
proc print data=final noobs;
title 'Three-Month Moving Averages';
run;

The example code above generates the following output:

 creating-and-using-multilabel-formats04

For additional information about the PROC FORMAT options that are used in the code examples above, as well as the options that are used in the other procedures, see the Base SAS X.X Procedures Guide for your specific SAS release. The procedures guide is available on the Base SAS Documentation web page (support.sas.com/documentation/onlinedoc/base/index.html).

Creating and Using Multilabel Formats was published on SAS Users.