Strengthen your programming skills with tips and techniques from the experts

You want to use an API to retrieve data and process it with SAS. How do you do it? PROC HTTP offers the features of the cURL command within your SAS code.

Strengthen your programming skills with tips and techniques from the experts

How to translate your cURL command into SAS code

You want to use an API to retrieve data and process it with SAS. How do you do it? PROC HTTP offers the features of the cURL command within your SAS code.

Simulate regression models that incorporate CLASS parameterizations

When you write a program that simulates data from a statistical model, you should always check that the simulation code is correct. One way to do this is to generate a large simulated sample, estimate the parameters in the simulated data, and make sure that the estimates are close to

8 ways to use the Kronecker product

The Kronecker product (also called the direct product) is a binary operation that combines two matrices to form a new matrix. The Kronecker product appears in textbooks about the design of experiments and multivariate statistics. The Kronecker product seems intimidating at first, but often one of the matrices in the

Splitting a data set into smaller data sets

SAS' Leonid Batkhan shows you how to split a large data set into many by a subsetting by a number of observations to produce smaller, better manageable data sets.

Fit a multivariate Gaussian mixture model by using the expectation-maximization (EM) algorithm

Last month a SAS programmer asked how to fit a multivariate Gaussian mixture model in SAS. For univariate data, you can use the FMM Procedure, which fits a large variety of finite mixture models. If your company is using SAS Viya, you can use the MBC or GMM procedures, which

How to create a path-based CASLIB to SASWORK for speedier analysis with SAS® Viya®

Is there programmatic way to reduce memory requirements of a CAS table in SAS® Viya®? Yes! SAS' Steven Sober shows you how.

Compute within-group multivariate statistics and store them in a list

I recently showed how to compute within-group multivariate statistics by using the SAS/IML language. However, a principal of good software design is to encapsulate functionality and write self-contained functions that compute and return the results. What is the best way to return multiple statistics from a SAS/IML module? A convenient

How to evaluate the multivariate normal log likelihood

The multivariate normal distribution is used frequently in multivariate statistics and machine learning. In many applications, you need to evaluate the log-likelihood function in order to compare how well different models fit the data. The log-likelihood for a vector x is the natural logarithm of the multivariate normal (MVN) density

Adjusting outliers with the 1.5 IQR rule

In my new book, End-to-End Data Science with SAS: A Hands-On Programming Guide, I use the 1.5 IQR rule to adjust multiple variables. This program utilizes a macro that loops through a list of variables to make the necessary adjustments and creates an output data set. One of the most

A parallel implementation of Monte Carlo simulation in SAS Viya

A previous article introduces the MAPREDUCE function in the iml action. (The iml action was introduced in Viya 3.5.) The MAPREDUCE function implements the map-reduce paradigm, which is a two-step process for distributing a computation to multiple threads. The example in the previous article adds a set of numbers by

Pandemic code samples, for SAS graphics

During the 2020 Coronavirus pandemic, you've probably formed a great appreciation for good, informative graphics. Good graphics can help you get a handle on thousands of individual data values, see the geographical distribution, or look for trends. In February, I wrote a blog post about creating a coronavirus dashboard with

Using SAS with Microsoft 365 (OneDrive, Teams, and SharePoint)

Learn how to use SAS code (PROC HTTP) to read and write files from your Microsoft OneDrive, Microsoft Teams or SharePoint Online. You'll learn how to create a Microsoft Office 365 app, connect to it with SAS, and automate the integration with your office productivity environment.

A general method for parallel computation in SAS Viya

The iml action in SAS Viya (introduced in Viya 3.5) provides a set of general programming tools that you can use to implement a custom parallel algorithm. This makes the iml action different than other Viya actions, which use distributed computations to solve specific problems in statistics, machine learning, and

Getting Started with Python Integration to SAS® Viya® - Part 3 - Loading a CAS Action Set

Are you looking for a specific CAS action to use in your project? Maybe you need to create a linear or logistic regression and can't seem to find the CAS action? In this post in the Getting Started with Python Integration to SAS® Viya® series, we are going to look

새로워진 SAS 커뮤니티를 소개합니다

오랜 시간동안 많은 사랑을 받아온 SAS 사용자 커뮤니티가 리뉴얼되었습니다. 한국에서 SAS 커뮤니티의 역사는 벌써 30년이 되었습니다. 1990년 SAS코리아 설립 이후 SAS User Group International-Korea(SUGI-K)라는 이름으로 활동한 SAS 사용자 모임이 2007년 MYSAS로 명칭을 바꾸었습니다. 그리고, 2010년 홈페이지를 개편하고 10년 만인 2020년, 사용자 모임의 활성화를 위해 새로운 SAS 커뮤니티 사이트로 여러분을 다시

Pool testing: The math behind combining medical tests

Testing people for coronavirus is a public health measure that reduces the spread of coronavirus. Dr. Anthony Fauci, a US infectious disease expert, recently mentioned the concept of "pool testing." The verb "to pool" means "to combine from different sources." In a USA Today article, Dr. Deborah Birx, the coordinator

What is a pooled variance?

The first time I saw a formula for the pooled variance, I was quite confused. It looked like Frankenstein's monster, assembled from bits and pieces of other quantities and brought to life by a madman. However, the pooled variance does not have to be a confusing monstrosity. The verb "to

Multi-way lookup tables

A lookup table is a programming technique where one or more values can be used to retrieve another value. For example, many years ago, I had benzene exposure estimates for 10 years (1940 to 1949) for each of five locations in a factory. Given a year and a job location,

The Kolmogorov D distribution and exact critical values

If you have ever run a Kolmogorov-Smirnov test for normality, you have encountered the Kolmogorov D statistic. The Kolmogorov D statistic is used to assess whether a random sample was drawn from a specified distribution. Although it is frequently used to test for normality, the statistic is "distribution free" in

Partition your CAS tables to greatly improve performance

Kevin Russell of SAS Technical Support shows you how partitioning CAS tables speeds processing.

Visualize the structure of a sparse matrix

Sometimes in matrix computations, it is important to display the nonzero elements of a matrix. This can be useful for visualizing the structure of a sparse matrix (one that has many zeros) and it is also useful when describing a matrix algorithm (such as Gaussian elimination) that introduces zeros at

Getting Started with Python Integration to SAS® Viya® - Part 2 - Working with CAS Actions and CASResults Objects

In the second post of the Getting Started with Python Integration to SAS® Viya® series we will learn about Working with CAS Actions and CASResults Objects. CAS actions are commands sent to the CAS server to run a task, and CASResults objects contain information returned from the CAS server. This

Getting Started with Python Integration to SAS® Viya® - Index

Index of articles on Getting Started with Python Integration to SAS® Viya®. Part 1 - Making a Connection Part 2 - Working with CAS Actions and CASResults Objects Part 3 - Loading a CAS Action Set Part 4 - Exploring Caslibs Part 5 - Uploading Data into CAS Part 6

How to access Federal Reserve Economic Data (FRED) with SASEFRED in SAS/ETS® software

SAS Public Sector's Elena Shtern is your guide as you extract data from the Federal Reserve Economic Data site using the SASEFRED interface engine, part of SAS/ETS® software.

Write a CAS data table by using the iml action

A previous article shows how to use the iml action to read a CAS data table into an IML matrix. This article shows how to write a CAS table from data in an IML matrix. You can read an overview of the iml action, which was introduced in SAS Viya

Read a CAS data table by using the iml action

A previous article compares a SAS/IML program that runs in PROC IML to the same program that runs in the iml action. (You can read an overview of the iml action.) The example in the previous article was very simple and did not read or write data. This article compares

Getting started with the iml action in SAS Viya

A previous article provides an introduction and overview of the iml action, which is available in SAS Viya 3.5. The article compares the iml action to PROC IML and states that most PROC IML programs can be modified to run in iml action. This article takes a closer look at

What's wrong with this code?

Whether you enjoy debugging or hate it, for programmers, debugging is a fact of life. It’s easy to misspell a keyword, scramble your array subscripts, or (heaven forbid!) forget a semicolon. That’s why we include a chapter on debugging in The Little SAS® Book and its companion book, Exercises and

An introduction to the iml action in SAS Viya

This article introduces the iml action, which is available in SAS Viya 3.5. The iml action supports most of the same syntax and functionality as the SAS/IML matrix language, which is implemented in PROC IML. With minimal changes, most programs that run in PROC IML also run in the iml

How to save Jupyter notebooks in assorted formats

Learning never stops. When SAS had to change this year’s SAS Global Forum (SASGF) to a virtual event, everyone was disappointed. I am, however, super excited about all of the papers and stream of video releases over the last month (and I encourage you to register for the upcoming live