Strengthen your programming skills with tips and techniques from the experts
A simple example of how you can combine SAS and open-source technologies to solve real business issues.
Strengthen your programming skills with tips and techniques from the experts
A simple example of how you can combine SAS and open-source technologies to solve real business issues.
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
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
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
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.
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.
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
A few examples to demonstrate some of the common output-related problems with ODS Graphics Procedures. If your graphical output does not appear as you wanted, consider the options that you are using and make sure that you are using the correct option.
I saw an interesting kangaroo map on reddit, and although the data was deemed "not entirely reliable" it seemed like a fun topic. And also a good exercise to try out the map labeling capabilities in the new Proc SGmap choropleth maps in SAS! For those of you not really
Many programmers are familiar with "short-circuit" evaluation in an IF-THEN statement. Short circuit means that a program does not evaluate the remainder of a logical expression if the value of the expression is already logically determined. The SAS DATA step supports short-circuiting for simple logical expressions in IF-THEN statements and
Summarizing numeric data is an important step in analyzing your data. CASL provides multiple actions that generate summary statistics. This blog provides a quick overview of three of those actions: SIMPLE.SUMMARY, AGGREGATION.AGGREGATE, and DATAPREPROCESS.RUSTATS.
Flying drones was a new & exciting hobby, and very cool fad a few years ago. In recent years, the drone manufacturers have added some really nice features to make the drones easier to fly and more capable ... but the government also added some new rules that have curbed
Do you want to bin a numeric variable into a small number of discrete groups? This article compiles a dozen resources and examples related to binning a continuous variable. The examples show both equal-width binning and quantile binning. In addition to standard one-dimensional techniques, this article also discusses various techniques
Binning transforms a continuous numerical variable into a discrete variable with a small number of values. When you bin univariate data, you define cut point that define discrete groups. I've previously shown how to use PROC FORMAT in SAS to bin numerical variables and give each group a meaningful name
Sometimes a little thing can make a big difference. I am enjoying a new enhancement of SAS/IML 15.1, which enables you to use a numeric vector as the column header or row header when you print a SAS/IML matrix. Prior to SAS/IML 15.1, you had to use the CHAR or
When my colleague, Robert Allison, blogged about visualizing the Mandelbrot set, I was reminded of a story from the 1980s, which was the height of the fractal craze. A research group in computational mathematics had been awarded a multimillion-dollar grant to purchase a supercomputer. When the supercomputer arrived and got
In a previous post, Zero to SAS in 60 Seconds- SAS Machine Learning on SAS Cloud, I documented my experience with a SAS free trial on the SAS Cloud. Well, the engineers at SAS have been busy and created another free trial. The new trial covers SAS Event Stream Processing
Have you ever had one of those moments when something you had assumed was true all your life, turned out not to be true? I remember that happening in my high school Spanish class (taught by the wonderful Señor Shoaf), when he let us in on a little secret -
Years ago I saw a line of SAS code that was really puzzling. It was a statement that started with: if 0 then … ; What? This was a statement that would always be evaluated as false. Why would anyone write such a statement? Recently, I was discussing with a
SAS supports more than 25 common probability distributions for the PDF, CDF, QUANTILE, and RAND functions. Of course, there are infinitely many distributions, so not every possible distribution is supported. If you need a less-common distribution, I've shown how to extend the functionality of Base SAS (by using PROC FCMP)
The guys over at reservations.com recently posted a really interesting idea, and a map to go along with it! They worked out an itinerary where you could spend one year traveling around the world (staying in a different place each week), and always be in a comfortable temperature around 70-75°
The RANK procedure (PROC RANK) is useful for ranking numeric variables in a data set across observations. You often see PROC RANK used to rank data into quartiles, deciles, or percentiles. This action requires that you use the GROUPS= option in the PROC RANK statement. This blog answers three questions
A few years ago Mandelbrot sets and fractals were all the rage! (Am I showing my age? Hahaha!) I thought creating some plots of this type of data would be a good way to sharpen my SAS programming skills, and it would make a nice/interesting example to help teach people
Have you ever tried to pass comma-delimited values to SAS macro or to a SAS macro function? How can SAS distinguish commas separating parameters or arguments from commas separating parts of the values? Passing comma-delimited value as an argument to a SAS macro function Let’s say you want to extract
In the SAS/IML language, a matrix contains data of one type: numeric or character. If you want to create a SAS data set that contains mixed-type data (numeric and character), SAS/IML 15.1 provides support to write multiple matrices to a data set by using a single statement. Specifically, the CREATE
As the 2020 Census approaches, I'm getting my code ready to plot the data! And a question I often hear is "Can you use SAS software to plot data on a Census block map?" Rather than tell you 'yes', let me show you 'yes' :) Preparing the map First I
Heat maps have many uses. You can use a heat map to visualize correlation matrices, to visualize longitudinal data ("lasagna plots"), and to visualize counts in any two-dimensional table. As of SAS 9.4m3, you can create heat maps in SAS by using the HEATMAP and HEATMAPPARM statements in PROC SGPLOT.
Earthquakes have been in the news lately - in particular, two very strong earthquakes that recently hit California. Exactly where did they hit? ... Let's plot it on a map! But before we get busy analyzing the California data, here's a picture to get you in the mood for studying
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 recently showed how to create an annotation data set that will overlay cell counts or percentages on a mosaic plot. A mosaic plot is a visual representation of a cross-tabulation of observed frequencies for two categorical variables. The mosaic plot with cell counts is shown to the right. The