Strengthen your programming skills with tips and techniques from the experts

The SAS DATA Step's DESCENDING option on BY variables quickly reveals a data set's largest value.

Strengthen your programming skills with tips and techniques from the experts

How to Emulate DATA Step DESCENDING BY Statements in SAS® Cloud Analytic Services (CAS)

The SAS DATA Step's DESCENDING option on BY variables quickly reveals a data set's largest value.

SAS Championship (golf) - plotting the results

The SAS Championship golf tournament is happening this week, here in Cary, North Carolina! If you're following along and watching the scores, you might wonder how they're doing compared to past years, and what kind of scores it generally takes to win. Follow along as I plot the data from

Top 5 SAS Books for Students

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-peek, you

When did household air conditioning become ubiquitous in the US?

We've had record high 90+ degree temperatures here in the southeast US this past week (September / October), and it has made me appreciate having an air conditioner. Indeed, air conditioners were pretty much invented here in North Carolina (see Eric Cramer). They are used in pretty much every building

Compute the geometric mean, geometric standard deviation, and geometric CV in SAS

I frequently see questions on SAS discussion forums about how to compute the geometric mean and related quantities in SAS. Unfortunately, the answers to these questions are sometimes confusing or even wrong. In addition, some published papers and web sites that claim to show how to calculate the geometric mean

What is a geometric mean?

There are several different kinds of means. They all try to find an average value from among a set of numbers. Although the most popular mean is the arithmetic mean, the geometric mean can be useful for problems in statistics, finance, and biology. A common application of the geometric mean

Machine learning with SASPy: Exploring and preparing your data (part 2)

This article continues a series that began with Machine learning with SASPy: Exploring and preparing your data (part 1). Part 1 showed you how to explore data using SASPy with Python. Here, in part 2, you will learn how to begin to prepare your data to use it within a

Data and Analytics Innovation using SAS & Spark - part 2

In part 1 of this post, we looked at setting up Spark jobs from Cloud Analytics Services (CAS) to load and save data to and from Hadoop. Now we are moving on to the next step in the analytic cycle, scoring data in Hadoop and executing SAS code as a

Graphing the record unemployment in California and New York

Lately we've been hearing a lot about "record low unemployment" in the news. Being a data guy, I wanted to see it for myself. Follow along as I create some custom unemployment graphs from the official data for California and New York (two of our most populous states). Or, if

Solve many optimization problems

One of the strengths of the SAS/IML language is its flexibility. Recently, a SAS programmer asked how to generalize a program in a previous article. The original program solved one optimization problem. The reader said that she wants to solve this type of problem 300 times, each time using a

Using Python to run jobs in your SAS Grid

One of the features of SAS Grid Manager (and SAS Grid Manager for Platform) introduced in SAS 9.4 M6 is the capability for the grid provider software to handle open-source workloads in addition to traditional SAS jobs. In this post, we’ll take a look at the steps required to get your SAS Grid Manager environment set up to utilize this functionality, and we’ll demonstrate the process of submitting Python code for execution in the SAS Grid.

How to retrieve contents of a SAS® Scalable Performance Data Server library

Just when you think you’ve seen it all, life can surprise you in a big way, making you wonder what else you've missed. That is what happened when I recently had a chance to work with the SAS® Scalable Performance Data Server, a product that's been around a while, but

The Hull moving average: Implement a custom time series smoother in SAS

A moving average is a statistical technique that is used to smooth a time series. My colleague, Cindy Wang, wrote an article about the Hull moving average (HMA), which is a time series smoother that is sometimes used as a technical indicator by stock market traders. Cindy showed how to

Plotting NC's 2019 special election results on a map

Yesterday we had a 'special election' here in NC, to elect new members to the House of Representatives for Congressional Districts 3 and 9. The election got a lot of national news coverage, therefore I thought people might like seeing the results plotted on a map. Before I decided to

Machine learning with SASPy: Exploring and preparing your data (part 1)

SASPy is a powerful Python library that interfaces with SAS and can help with your machine-learning solutions. SASPy was created for Python programmers to leverage the power of SAS within their Python scripts. If you are not familiar with SASPy, see the following resources: Introducing SASPy: Use Python code to

SAS Viya: Package for Python API for deep learning and image processing: DLPy

Editor's Note: This article was translated and edited by SAS USA and was originally written by Makoto Unemi. The original text is here. SAS previously provided SAS Scripting Wrapper for Analytics Transfer (SWAT), a package for using SAS Viya functions from various general-purpose programming languages such as Python. In addition

How to publish to a Microsoft Teams channel using SAS

If you use Microsoft Teams for collaboration, you should use it for operational messages too. You can use SAS to automate tailored notices to your Teams Channel.

Use cosine similarity to make recommendations

When you order an item online, the website often recommends other items based on your purchase. In fact, these kinds of "recommendation engines" contributed to the early success of companies like Amazon and Netflix. SAS uses a recommender engine to suggest articles on the SAS Support Communities. Although recommender engines

YouTube.com/SASusers: a pop of personality

Editor's Note: SAS' Evan Mann contributed to this post. First came SAS' reputation as a great place to work. Next came a storytellers article series offering a glimpse of the people behind the brand. Now there's the SAS Users YouTube Channel, where tutorial videos provide a window into some of

How to plot hurricane data on a map

As we're in the thick of hurricane season, I'm sure some of my fellow map-makers are wanting to create their own custom hurricane maps. In this blog post, I step you through the process, so you'll know where to find all the pieces, and how to put them together. I

Cosine similarity of vectors

An important application of the dot product (inner product) of two vectors is to determine the angle between the vectors. If u and v are two vectors, then cos(θ) = (u ⋅ v) / (|u| |v|) You could apply the inverse cosine function if you wanted to find θ in

Annotate features of a schematic box plot in SGPLOT

A SAS programmer asked an intriguing question on the SAS Support Communities: Can you use SAS to create a graph that shows how the elements in a box-and-whiskers plot relate to the data? The SAS documentation has several examples that explain how to read a box plot. One of the

Data and Analytics Innovation using SAS & Spark - part 1

This article is not a tutorial on Hadoop, Spark, or big data. At the same time, no prerequisite knowledge of these technologies is required for understanding. We’ll give you enough background prior to diving into the details. In simplest terms, the Hadoop framework maintains the data and Spark controls and

Using SAS Optimization with Python and containers

A simple example of how you can combine SAS and open-source technologies to solve real business issues.

Where to take a scenic drive in each of the 50 US states!

Summer is winding down, and cooler fall weather is just around the corner. You might soon be able to take a pleasant drive with the windows down, while enjoying the scenery. But where should you go? What are the most scenic roads for that drive? Read along to see a

Conditionally append observations to a SAS data set

Most SAS programmers know how to use PROC APPEND or the SET statement in DATA step to unconditionally append new observations to an existing data set. However, sometimes you need to scan the data to determine whether or not to append observations. In this situation, many SAS programmers choose one

Two tips for optimizing a function that has a restricted domain

An important application of nonlinear optimization is finding parameters of a model that fit data. For some models, the parameters are constrained by the data. A canonical example is the maximum likelihood estimation of a so-called "threshold parameter" for the three-parameter lognormal distribution. For this distribution, the objective function is

Execute Python inside a SAS Decision: Learn how in less than 5 minutes

You can now easily embed a python script in a SAS decision with SAS Intelligent Decisioning. If you want to execute in MAS, you do not need to wrap it in DS2 anymore. The python code node does it for you. Here is how you can achieve it in less than 5 minutes.

A skeptic's guide to statistics in the media

News outlets share stats and graphs that they source from public data. It takes data literacy skills to critique the stats you see, and investigate more.

Timing performance in SAS/IML: Built-in functions versus Base SAS functions

One of my friends likes to remind me that "there is no such thing as a free lunch," which he abbreviates by "TINSTAAFL" (or TANSTAAFL). The TINSTAAFL principle applies to computer programming because you often end up paying a cost (in performance) when you call a convenience function that simplifies