sas author

11月 122019

The t-test is a very useful test that compares one variable (perhaps blood pressure) between two groups. T-tests are called t-tests because the test results are all based on t-values. T-values are an example of what statisticians call test statistics. A test statistic is a standardized value that is calculated from sample data during a hypothesis test. It is used to determine whether there is a significant difference between the means of two groups. With all inferential statistics, we assume the dependent variable fits a normal distribution. When we assume a normal distribution exists, we can identify the probability of a particular outcome. The procedure that calculates the test statistic compares your data to what is expected under the null hypothesis. There are several SAS Studio tasks that include options to test this assumption. Let's use the t-test task as an example.

You start by selecting:

Tasks and Utilities □ Tasks □ Statistics □ t Tests

On the DATA tab, select the Cars data set in the SASHELP library. Next request a Two-sample test, with Horsepower as the Analysis variable and Cylinders as the Groups variable. Use a filter to include only 4- or 6-cylinder cars. It should look like this:

On the OPTIONS tab, check the box for Tests for normality as shown below.

All the tests for normality for both 4-cylinder and 6-cylinder cars reject the null hypothesis that the data values come from a population that is normally distributed. (See the figure below.)

Should you abandon the t-test results and run a nonparametric test analysis such as a Wilcoxon Rank Sum test that does not require normal distributions?

This is the point where many people make a mistake. You cannot simply look at the results of the tests for normality to decide if a parametric test is valid or not. Here is the reason: When you have large sample sizes (in this data set, there were 136 4-cylinder cars and 190 6-cylinder cars), the tests for normality have more power to reject the null hypothesis and often result in p-values less than .05. When you have small sample sizes, the tests for normality will not be significant unless there are drastic departures from normality. It is with small sample sizes where departures from normality are important.

The bottom line is that the tests for normality often lead you to make the wrong decision. You need to look at the distributions and decide if they are somewhat symmetrical. The central limit theory states that the sampling distribution of means will be normally distributed if the sample size is sufficiently large. "Sufficiently large" is a judgment call. If the distribution is symmetrical, you may perform a t-test with sample sizes as small as 10 or 20.

The figure below shows you the distribution of horsepower for 4- and 6-cylinder cars.

With the large sample sizes in this data set, you should feel comfortable in using a t-test. The results, shown below, are highly significant.

If you are in doubt of your decision to use a parametric test, feel free to check the box for a nonparametric test on the OPTIONS tab. Running a Wilcoxon Rank Sum test (a nonparametric alternative to a t-test), you also find a highly significant difference in horsepower between 4- and 6-cylinder cars. (See the figure below.)

You can read more about assumptions for parametric tests in my new book, A Gentle Introduction to Statistics Using SAS Studio.

For a sneak preview check out the free book excerpt. You can also learn more about SAS Press, check out the up-and-coming titles, and receive exclusive discounts. To do so, make sure to subscribe to the newsletter.

Testing the Assumption of Normality for Parametric Tests was published on SAS Users.

11月 062019

I have been programming SAS for a LONG time and have never seen much in the way of programming standards. For example, most SAS programmers indent DATA and PROC statements (I like three spaces). Most programmers do not like to see more than one statement on a line and most agree that there should be blank lines between program boundaries (DATA and PROC steps).

I thought I would share some of my thoughts on programming standards, with the hope that others will chime in with their ideas.

    • I like to indent all the statements in a DO group or DO loop. If there are nested groups, each one gets indented as well.
    • I prefer variable names in proper case.
    • I am not a fan of camel-case. For example, I prefer Weight_Kg to WeightKg. The reason that some programmers like camel-case is that SAS will automatically split a variable name at a capital letter in some headings.
    • I like my TITLE statements in open code, not inside a PROC. To me, that makes sense because TITLE statements are global.
    • There should be no conversion messages (character to numeric or numeric to character) in the SAS log. For example use Num = INPUT(Char_Num,12.); instead of Num = 1*Char_Num;. The latter statement forces an automatic character to numeric conversion and places a message in the log.
    • I always use the statement ODS NOPROCTITLE;. This eliminates the default SAS procedure name at the top of the output.
    • Although fewer and fewer people are reading raw text data, I like my @ signs to all line up in my INPUT statement.
    • I like to use the /* and */ comments to define all macro variables. For example:

Notice that I prefer named parameters in my macros, instead of positional parameters.

If this seems like too much work - SAS Studio has an automatic formatting tool that can help standardize your programs. For example, look at the code below:

Really ugly, right? Here is how you can use the automatic formatting tool in SAS Studio.

When you click this icon, the program now looks like this:

That’s pretty much the way I would write it. By the way, if you don't like how Studio formatted your code, enter a control-z to undo it.

For more tips on writing code and how to get started in SAS Studio – check out my book, Learning SAS by Example: A Programmer’s Guide, Second Edition. You can also download a free book excerpt. To also learn more about SAS Press, check out the up-and-coming titles, and receive exclusive discounts make sure to subscribe to the SAS Books newsletter.

Making your SAS code more readable was published on SAS Users.

10月 292019

Thank you to Lora Delwiche and Susan Slaughter for providing the following information:

Six editions is a lot! If you had told us back when we wrote the first edition of The Little SAS Book that someday we would write a sixth, we would have wondered how we could possibly find that much to say. After all, it is supposed to be The Little SAS Book, isn’t it? But the developers at SAS are constantly hard at work inventing new and better ways of analyzing and visualizing data. And some of those ways turn out to be so fundamental that they belong even in a little book about SAS.

Interface independence

One of the biggest changes to SAS software in recent years is the proliferation of interfaces. SAS programmers have more choices than ever before. Previous editions contained some sections specific to the SAS windowing environment (also called Display Manager). We wrote this edition for all SAS programmers whether you use SAS Studio, SAS Enterprise Guide, the SAS windowing environment, or run in batch. That sounds easy, but it wasn’t. There are differences in how SAS behaves with different interfaces, and these differences can be very fundamental. In particular, the system option that sets the rules for names of variables varies depending on how you run SAS. So old sections had to be rewritten, and we added a whole new section showing how to use variable names containing blanks and special characters.

New ways to read and write Microsoft Excel files

Previous editions already covered how to read and write Microsoft Excel files, but SAS developers have created new ways that are even better. This edition contains new sections about the XLSX LIBNAME engine and the ODS EXCEL destination.


From the very first edition, The Little SAS Book always covered PROC SQL. But it was in an appendix, and over time we noticed that most people ignore appendices. So for this edition, we removed the appendix and added new sections on using PROC SQL to:

• Subset your data
• Join data sets
• Add summary statistics to a data set
• Create macro variables with the INTO clause

For people who are new to SQL, these sections provide a good introduction; for people who already know SQL, they provide a model of how to leverage SQL in your SAS programs.

Updates and additions throughout the book

Almost every section in this edition has been changed in some way. We added new options, made sure everything is up-to-date, and ran every example in every SAS interface noting any differences. For example, PROC SGPLOT has some new options, the default ODS style for PDF has changed, and the LISTING destination behaves differently in different interfaces. Here’s a short list, in no particular order, of new or expanded topics in the sixth edition:

• More examples with permanent SAS data sets, CSV files, or tab-delimited files
• More log notes throughout the book showing what to look for
• LIKE or sounds-like (=*) operators in WHERE statements
• Grouping data with a user-defined format and the PUT function
• Iterative DO groups
• DO WHILE and DO UNTIL statements
• %DO statements

Even though we have added a lot to this edition, it is still a little book. In fact, this edition is shorter than the last—by 12 pages! We think this is the best edition yet. For a sneak preview check out the free book excerpt. You can also learn more about SAS Press, check out the up-and-coming titles, and to exclusive discounts -- make sure to subscribe to the newsletter.

The Little SAS Book 6.0: The best-selling SAS book gets even better was published on SAS Users.

10月 092019

As a fellow student, I know that making sure you get the right books for learning a new skill can be tough. To get you started off right, I would like to share the top SAS books that professors are requesting for students learning SAS. With this inside sneak-peak, you can see what books instructors and professors are using to give new SAS users a jump-start with their SAS programming skills.

1. Learning SAS by Example: A Programmer's Guide, Second Edition

At the top of the list is Ron Cody’s Learning SAS by Example: A Programmer’s Guide, Second Edition. This book teaches SAS programming to new SAS users by building from very basic concepts to more advanced topics. Many programmers prefer examples rather than reference-type syntax, and so this book uses short examples to explain each topic. The new edition of this classic has been updated to SAS 9.4 and includes new chapters on PROC SGPLOT and Perl regular expressions. Check out this free excerpt for a glimpse into the way the book can help you summarize your data.

2. An Introduction to SAS University Edition

I cannot recommend this book highly enough for anyone starting out in data analysis. This book earns a place on my desk, within easy reach. - Christopher Battiston, Wait Times Coordinator, Women's College Hospital

The second most requested book will help you get up-and-running with the free SAS University Edition using Ron Cody’s easy-to-follow, step-by-step guide. This book is aimed at beginners who want to either use the point-and-click interactive environment of SAS Studio, or who want to write their own SAS programs, or both.

The first part of the book shows you how to perform basic tasks, such as producing a report, summarizing data, producing charts and graphs, and using the SAS Studio built-in tasks. The second part of the book shows you how to write your own SAS programs, and how to use SAS procedures to perform a variety of tasks. In order to get familiar with the SAS Studio environment, this book also shows you how to access dozens of interesting data sets that are included with the product.

For more insights into this great book, check out Ron Cody’s useful tips for SAS University Edition in this recent SAS blog.

3. The Little SAS Book: A Primer, Fifth Edition

Our third book is a classic that just keeps getting better. The Little SAS Book is essential for anyone learning SAS programming. Lora Delwiche and Susan Slaughter offer a user-friendly approach so readers can quickly and easily learn the most commonly used features of the SAS language. Each topic is presented in a self-contained two-page layout complete with examples and graphics. Also, make sure to check out some more tips on learning SAS from the authors in their blog post.

We are also excited to announce that the newest edition of The Little SAS Book is coming out this Fall! The sixth edition will be interface independent, so it won’t matter if you are using SAS Studio, SAS Enterprise Guide, or the SAS windowing environment as your programming interface. In this new edition, the authors have included more examples of creating and using permanent SAS data sets, as well as using PROC IMPORT to read data. The new edition also deemphasizes reading raw data files using the INPUT statement—a topic that is no longer covered in the new base SAS programmer certification exam. Check out the upcoming titles page for more information!

4. SAS Certification Prep Guide: Statistical Business Analysis Using SAS 9

Number four is a must-have study guide for the SAS Certified Statistical Business Analyst Using SAS 9 exam. Written for both new and experienced SAS programmers, the SAS Certification Prep Guide: Statistical Business Analysis Using SAS 9 is an in-depth prep guide for the SAS Certified Statistical Business Analyst Using SAS 9: Regression and Modeling exam. The authors step through identifying the business question, generating results with SAS, and interpreting the output in a business context. The case study approach uses both real and simulated data to master the content of the certification exam. Each chapter also includes a quiz aimed at testing the reader’s comprehension of the material presented. To learn more about this great guide, watch an interview with co-author Joni Shreve.

5. SAS for Mixed Models: Introduction and Basic Applications

Models are a vital part of analyzing research data. It seems only fitting, then, that this popular SAS title would be our fifth most popular book requested by SAS instructors. Mixed models are now becoming a core part of undergraduate and graduate programs in statistics and data science. This book is great for those with intermediate-level knowledge of SAS and covers the latest capabilities for a variety of SAS applications. Be sure to read the review of this book by Austin Lincoln, a technical writer at SAS, for great insights into a book he calls a “survival guide” for creating mixed models.

Want more?

I hope this list will help in your search for a SAS book that will get you to the next step in your SAS education goals. To learn more about SAS Press, check out our up-and-coming titles, and to receive exclusive discounts make sure to subscribe to our newsletter.

Top 5 SAS Books for Students was published on SAS Users.

9月 232019

The SAS Global Forum 2020 call for content is open until Sept. 30, 2019. Are you thinking of submitting a paper? If so, we have a few tips adapted from The Global English Style Guide that will help your paper shine. By following Global English guidelines, your writing will be clearer and easier to understand, which can boost the effectiveness of your communications.

Even if you’re not planning on submitting a paper and producing technical information is not your primary job function, being aware of Global English guidelines can help you communicate more effectively with your colleagues from around the world.

1. Use Short Sentences

Short sentences are less likely to contain ambiguities or complexities. For task-oriented information, try to limit your sentences to 20 words. If you have written a long sentence, break it up into two or more shorter sentences.

2. Use Complete Sentences

Incomplete sentences can be confusing for non-native speakers because the order of sentence parts is different in other languages. In addition, incomplete sentences can cause machine-translation software to produce garbled results. For example, the phrases below are fragments that may cause issues for readers:

Original: Lots of info here. Not my best, but whatever. Waiting to hear back until I do anything.
Better: There is lots of info here. It’s not my best work, but I am waiting to hear back until I do anything.

An extremely common location to encounter sentence fragments is in the introductions to lists. For example, consider the sentence introducing the list below.

The programs we use for analysis are:
• SAS Visual Analytics
• SAS Data Mining and Machine Learning
• SAS Visual Investigator

If you use an incomplete sentence to introduce a list, consider revising the sentence to be complete, then continue on to the list, as shown below.

We use the following programs in our analysis:
• SAS Visual Analytics
• SAS Data Mining and Machine Learning
• SAS Visual Investigator

3. Untangle Long Noun Phrases

A noun phrase can be a single noun, or it can consist of a noun plus one or more preceding words such as articles, pronouns, adjectives, and other nouns. For example, the following sentence contains a noun phrase with 6 words:

The red brick two-story apartment building was on fire.

Whenever possible, limit noun phrases to no more than three words while maintaining comprehensibility.

4. Expand -ED Verbs That Follow Nouns Whenever Possible

A past participle is the form of a verb that usually ends in -ed. It can be used as both the perfect and past tense of verbs as well as an adjective. This double use can be confusing for non-native English speakers. Consider the following sentence:

This is the algorithm used by the software.

In this example, the word “used” is an adjective, but it may be mistaken for a verb. Avoid using -ed verbs in ambiguous contexts. Instead, add words such as “that” or switch to the present tense to help readers interpret your meaning. A better version of the previous example sentence follows.

This is the algorithm that is used by the software.

5. Always Revise -ING Verbs That Follow Nouns

The name of this tip could have been written as “Always Revise -ING Verbs Following Nouns.” But that’s exactly what we want to avoid! If an -ING word immediately follows and modifies a noun, then either expand it or eliminate it. These constructions are ambiguous and confusing.

6. Use “That” Liberally

The word “that” is your friend! In English, the word “that” is often omitted before a relative clause. If it doesn’t feel unnatural or forced, try to include “that” before these clauses, as shown in the following example.

Original: The file you requested could not be located.

Better: The file that you requested could not be located.

7. Choose Simple, Precise Words That Have a Limited Range of Meanings

We are not often accustomed to thinking about the alternative meanings for the words we use. But consider that many words have multiple meanings. If translated incorrectly, these words could make your writing completely incomprehensible and possibly ridiculous. Consider the alternate meanings of a few of the words in the following sentences:

When you hover over the menu, a box appears.

We are deploying containers in order to scale up efficiency.

8. Don’t Use Slang, Idioms, Colloquialisms, or Figurative Language

In the UK, retail districts are called “high street.” In the US, they are called “main street.” This is just one example of how using colloquialisms can cause confusion. And Brits and Americans both speak the same language!

Especially in formal communications, keep your writing free of regional slang and idioms that cannot be easily understood by non-native English speakers. Common phrases such as “under the weather,” “piece of cake,” or “my neck of the woods” make absolutely no sense when translated literally.

We hope these Global English tips help you write your Global Forum paper, or any other communications you might produce as part of your work. For more helpful tips, read The Global English Style Guide: Writing Clear, Translatable Documentation for a Global Market by John R. Kohl.

Top 8 Global English Guidelines was published on SAS Users.

9月 082019

Today, September 8th, is International Literacy Day! A day celebrated by UNESCO since 1967 to emphasize the importance of literacy around the world. Here at SAS, we have decided to highlight data literacy, a critical part of our evolving knowledge as data and analytics continue to dominate the way we do business.

SAS Press author Susan Slaughter defines data literacy as, “understanding that data are not dry, dusty, abstract squiggles on a computer screen, but represent living things: people, plants, animals. You know you are fluent in a foreign language when you are comfortable speaking it and can communicate what you want to say. The same is true for data literacy; it is about reaching a level of comfort, about being able to communicate what is important to you, and about seeing the meaning behind the data.

Everyone knows that technology is becoming more and more a part of everyday life. Without data literacy, people become passive recipients; with data literacy, you can actively engage with technology. SAS calls it ‘the power to know’ and that's an accurate description.”

SAS Press has been helping users be more fluent in data literacy for almost 30 years! The Little SAS Book is about to publish its sixth edition and has been helping programmers learn SAS and analyze their data since 1995.

Free SAS Press e-books

To celebrate national literacy day and do our part in sharing about data literacy, SAS Press would like to share with you our free e-books on a range of topics related to data analytics. These books focus on topics such as text analytics, data management, AI, and Machine Learning.

Moving to the cloud?

Looking for information on SAS Viya? Download our two new free e-books on Exploring SAS Viya. Both books cover the features and capabilities of SAS Viya. SAS Viya extends the SAS platform to enable everyone – data scientists, business analysts, developers, and executives alike – to collaborate and realize innovative results faster.

Here is a list of our free e-books on SAS Viya:

Exploring SAS ®Viya®: Programming and Data Management
This first book in the series covers how to access data files, libraries, and existing code in SAS® Studio. You also will learn about new procedures in SAS Viya, how to write new code, and how to use some of the pre-installed tasks that come with SAS® Visual Data Mining and Machine Learning.

Exploring SAS® Viya®: Visual Analytics, Statistics, and Investigations
Data visualization enables decision-makers to see analytics presented visually so that they can grasp difficult concepts or identify new patterns. This book includes four visualization solutions powered by SAS Viya: SAS Visual Analytics, SAS Visual Statistics, SAS Visual Text Analytics, and SAS Visual Investigator.

Interested in learning more?

As becoming more data literate becomes increasingly more important in our daily lives, knowing where to get new information and tools to learn becomes critical to innovation and change. To stay up-to-date on new SAS Press books and our new free e-books releases, subscribe to our monthly newsletter.

Celebrating #InternationalLiteracyDay with Free SAS E-books! was published on SAS Users.

9月 072019

By 2020, 50% of organizations will lack sufficient AI and data literacy skills to achieve business value. – Gartner

What is data literacy?

Data literacy is the ability to read, work with, analyze, and argue with data. – Wikipedia

Data literacy is the ability to derive meaningful information from data, just as literacy in general is the ability to derive information from the written word. –

Why is it important?

As data and analytics become core to the enterprise, and data becomes an organizational asset, employees must have at least a basic ability to communicate and understand conversations about data. Just as it is a given that employees are now competent in word processing and spreadsheets, the ability to “speak data” will become an integral aspect of most day-to-day jobs.

Gone will be the days when data scientists, analysts, and statisticians are the only ones “speaking data.” Valerie Logan, Senior Director Analyst, Gartner, says workforce data literacy must treat information as a second language. Just as we expect all employees today to have a basic level of computer literacy, use email, and understand spreadsheets, employees will also need to be able to understand and speak basic data.

Chris Hemedinger, author of SAS for Dummies, touched on this in his blog a skeptics guide to statistics in the media. He is old enough to remember when USA Today began publication in the early 1980s. He remembers scanning each edition for the USA Today Snapshots, a mini infographic feature that presented some statistics in a fun and interesting way. “Back then, I felt that these stats made me a little bit smarter for the day. I had no reason to question the numbers I saw, nor did I have the tools, skill, or data access to check their work.”

Chris warns that as more and more “news articles and editorial pieces often use simplified statistics to convey a message or support an argument,” we will need to learn that “statistics in the media should not be accepted at face value.” Learning to analyze and understand data and statistics will become increasingly more vital for future generations.

Best-selling SAS Press author, Ron Cody, cautions that with the augmented technology that allows non-programmers to be able to run complex programs to search databases, summarize data, and conduct statistical tests, it is vital that everyone has a basic understanding of the data and analytics behind the results. “With advances in artificial intelligence, we may be able to tell the computer our problem and let it solve it and tell us the answer.” With technology advancing so quickly with AI, we will all need to understand the data and avoid including bias into our models. Misunderstood data can negatively influence AI algorithms or interpretation of models.

The future

Tom Fisher, Senior Vice President of Business Development at SAS explains, “the convergence of model management with data management represents one of the most exciting business opportunities of the future. The merging and blending of these two disciplines should enable the elimination of bias that may occur in the collection and aggregation of data.” Initiatives such as MIT’s Data Nutrition Project address the missing step in the model development pipeline, “assessing data sets based on standard quality measures that are both qualitative and quantitative.” As Fisher concludes, “these kinds of approaches are designed to allow consumers of data, as input to models, to have a more complete understanding of the data that’s being ingested. At the end of the day, the goal of these integrated disciplines is to provide greater accuracy and comfort with the result sets that are being delivered by data scientists and data engineers.”

As the Gartner report quoted earlier notes, as organizations become more data-driven, poor data literacy will become an inhibitor to growth. But not everyone wants to be a statistician or data scientist. This is where the analogy to computer literacy parts ways. We don’t all have to have a statistics degree – AI can help. SAS is developing solutions where AI is augmented into its most sophisticated and powerful solutions to give everyone data literacy. For example, SAS® Model Manager looks at the data and the problem to suggest models. It can then choose the best model based on the user’s criteria, test the model, and score. Technology to report and explain the results, and even answer questions is under development – all in natural language! A virtual personal assistant who can “speak data” and translate.

While data literacy will become increasingly important, so too will tools to help moderate and translate the data that will continue to drive our enterprises and our lives.

Become more data literate with our library of Getting Started with SAS, Statistics, Machine Learning, and Data Management books. Visit SAS Books.

Explore SAS Analytics Industry Solutions at

Why we need to learn how to "speak data" in a data-driven future was published on SAS Users.

7月 102019

Posted on behalf of SAS Press author Derek Morgan.

I was sitting in a model railroad club meeting when one of our more enthusiastic young members said, "Wouldn't it be cool if we could make a computer simulation, with trains going between stations and all. We could have cars and engines assigned to each train and timetables and…"

So, I thought to myself, “Timetables… I bet SAS can do that easily… sounds like something fun for Mr. Dates and Times."

As it turns out, the only easy part of creating a timetable is calculating the time. SAS handles the concept of elapsed time smoothly. It’s still addition and subtraction, which is the basis of how dates and times work in SAS. If a train starts at 6:00 PM (64,800 seconds of the day) and arrives at its destination 12 hours (43,200 seconds) later, it arrives at 6:00 AM the next day. The math is start time+duration=end time (108,000 seconds,) which is 6:00 AM the next day. It doesn’t matter which day, that train is always scheduled to arrive at 6:00 AM, 12 hours from when it left.

It got a lot more complicated when the group grabbed onto the idea. One of the things they wanted to do was to add or delete trains and adjust the timing so multiple trains don’t run over the same track at the same time. This wouldn’t be that difficult in SAS; just create an interactive application, but… I’m the only one who has SAS. So how do I communicate my SAS database with the “outside world”? The answer was Microsoft Excel, and this is where it gets thorny.

It’s easy enough to send SAS data to Excel using ODS EXCEL and PROC REPORT, but how could I get Excel to allow the club to manipulate the data I sent?
I used the COMPUTE block in PROC REPORT to display a formula for every visible train column. I duplicated the original columns (with corresponding names to keep it all straight) and hid them in the same spreadsheet. The EXCEL formula code is in line 8.

Compute Block Code:

I also added three rows to the dataset at the top. The first contains the original start time for each train, the second contains an offset, which is always zero in the beginning, while the third row was blank (and formatted with a black background) to separate it from the actual schedule.

Figure 1: Schedule Adjustment File

The users can change the offset to change the starting time of a train (Column C, Figure 2.) The formula in the visible columns adds the offset to the value in each cell of the corresponding hidden column (as long as it isn’t blank.) You can’t simply add the offset to the value of the visible cell, because that would be a circular reference.

The next problem was moving a train to an earlier starting time, because Excel has no concept of negative time (or date—a date prior to the Excel reference date of January 1, 1900 will be a character value in Excel and cause your entire column to be imported into SAS as character data.) Similarly, you can’t enter -1:00 as an offset to move the starting time of our 5:35 AM train to 4:35 AM. Excel will translate “-1:00” as a character value and that will cause a calculation error in Excel. In order to move that train to 4:35 AM, you have to add 23 hours to the original starting time (Column D, Figure 2.)

Figure 2: Adjusting Train Schedules

After the users adjust the schedules, it’s time to return our Excel data to SAS, which creates more challenges. In the screenshot above, T534_LOC is the identifier of a specific train, and the timetable is kept in SAS time values. Unfortunately, PROC IMPORT using DBMS=XLSX brings the train columns into SAS as character data. T534_LOC also imports as the actual Excel value, time as a fraction of a day.

Figure 3: How the Schedule Adjustment File Imports to SAS

While I can fix that by converting the character data to numeric and multiplying by 86,400, I still need the original column name of T534_LOC for the simulation, so I would have to rename each character column and output the converted data to the original column name. There are currently 146 trains spread across 12 files, and that is a lot of work for something that was supposed to be easy! Needless to say, this “little” side project, like most model railroads, is still in progress. However, this exercise in moving time data between Microsoft Excel and SAS gave me even more appreciation for the way SAS handles date and time data.

Figure 4 is a partial sample of the finished timetable file, generated as an RTF file using SAS. The data for trains 534 and 536 are from the spreadsheet in Figure 1.

Figure 4: Partial Sample Timetable

Want to learn more about how to use and manipulate dates, times, and datetimes in SAS? You'll find the answers to these questions and much more in my book The Essential Guide to SAS Dates and Times, Second Edition. Updated for SAS 9.4, with additional functions, formats, and capabilities, the Second Edition has a new chapter dedicated to the ISO 8601 standard and the formats and functions that are new to SAS, including how SAS works with Universal Coordinated Time (UTC). Chapter 1 is available as a free preview here.

For updates on new SAS Press books and great discounts subscribe to the SAS Press New Book Newsletter.

SAS Press Author Derek Morgan on Timetables and Model Trains was published on SAS Users.

7月 032019

One of my favorite parts of summer is a relaxing weekend by the pool. Summer is the time I get to finally catch up on my reading list, which has been building over the year. So, if expanding your knowledge is a goal of yours this summer, SAS Press has a shelf full of new titles for you to explore. To help navigate your selection we asked some of our authors what SAS books were on their reading lists for this summer?

Teresa Jade

Teresa Jade, co-author of SAS® Text Analytics for Business Applications: Concept Rules for Information Extraction Models, has already started The DS2 Procedure: SAS Programming Methods at Work by Peter Eberhardt. Teresa reports that the book “is a concise, well-written book with good examples. If you know a little bit about the SAS DATA step, then you can leverage what you know to more quickly get up to speed with DS2 and understand the differences and benefits.”

Derek Morgan

Derek Morgan, author of The Essential Guide to SAS® Dates and Times, Second Edition, tells us his go-to books this summer are Art Carpenter’s Complete Guide to the SAS® REPORT Procedure and Kirk Lafler's PROC SQL: Beyond the Basics Using SAS®, Third Edition. He also notes that he “learned how to use hash objects from Don Henderson’s Data Management Solutions Using SAS® Hash Table Operations: A Business Intelligence Case Study.”

Chris Holland

Chris Holland co-author of Implementing CDISC Using SAS®: An End-to-End Guide, Revised Second Edition, recommends Richard Zink’s JMP and SAS book, Risk-Based Monitoring and Fraud Detection in Clinical Trials Using JMP® and SAS®, which describes how to improve efficiency while reducing costs in trials with centralized monitoring techniques.

And our recommendations this summer?

Download our two new free e-books which illustrate the features and capabilities of SAS® Viya®, and SAS® Visual Analytics on SAS® Viya®.

Want to be notified when new books become available? Sign up to receive information about new books delivered right to your inbox.

Summer reading – Book recommendations from SAS Press authors was published on SAS Users.

6月 182019

What is Item Response Theory?

Item Response Theory (IRT) is a way to analyze responses to tests or questionnaires with the goal of improving measurement accuracy and reliability.

A common application is in testing a student’s ability or knowledge. Today, all major psychological and educational tests are built using IRT. The methodology can significantly improve measurement accuracy and reliability while providing potential significant reductions in assessment time and effort, especially via computerized adaptive testing. For example, the SAT and GRE both use Item Response Theory for their tests. IRT takes into account the number of questions answered correctly and the difficulty of the question.

In recent years, IRT models have also become increasingly popular in health behavior, quality of life, and clinical research. There are many different models for IRT. Three of the most popular are:

The Rasch model

Two-parameter model

Graded Response model

Early IRT models (such as the Rasch model and two-parameter model) concentrate mainly on dichotomous responses. These models were later extended to incorporate other formats, such as ordinal responses, rating scales, partial credit scoring, and multiple category scoring.

Item Response Theory Models Using SAS

Ron Cody and Jeffrey K. Smith’s book, Test Scoring and Analysis Using SAS, uses SAS PROC IRT to show how to develop your own multiple-choice tests, score students, produce student rosters (in print form or Excel), and explore item response theory (IRT).

Aimed at non-statisticians working in education or training, the book describes item analysis and test reliability in easy-to-understand terms and teaches SAS programming to score tests, perform item analysis, and estimate reliability.

For those with a more statistical background, Bayesian Analysis of Item Response Theory Models Using SAS describes how to estimate and check IRT models using the SAS MCMC procedure. Written especially for psychometricians, scale developers, and practitioners, numerous programs are provided and annotated so that you can easily modify them for your applications.

Assessment has played, and continues to play, an integral part in our work and educational settings. IRT models continue to be increasingly popular in many other fields, such as medical research, health sciences, quality-of-life research, and even marketing research. With the use of IRT models, you can not only improve scoring accuracy but also economize test administration by adaptively using only the discriminative items.

Interested in learning more? Check out our chapter previews available for free. Want to learn more about SAS Press? Explore our online bookstore and subscribe to our newsletter to get all the latest discounts, news, and more.

Further resources

SAS Blogs:
New at SAS: Psychometric Testing by Charu Shankar
SAS author’s tip: Bayesian analysis of item response theory models

SAS Communities:
SAS Communities: Custom Task Tuesday: SAS Global Forum/PROC IRT Edition!

SAS Global Forum Paper:
Item Response Theory: What It Is and How You Can Use the IRTProcedure to Apply It by Xinming An and Yiu-Fai Yung

SAS Documentation:
The IRT Procedure
SAS/STAT 14.1 User Guide: The IRT Procedure
SAS/STAT 14.2 User Guide: Help Center

Understanding Item Response Theory with SAS was published on SAS Users.