Last week I showed how to use PROC EXPAND to compute moving averages and other rolling statistics in SAS. Unfortunately, PROC EXPAND is part of SAS/ETS software and not every SAS site has a license for SAS/ETS. For simple moving averages, you can write a DATA step program, as discussed

The post Read more »

Tags: data analysis, Statistical Programming, Uncategorized, vectorization

Posted in SAS | Comments Off on Rolling statistics in SAS/IML

A common question on SAS discussion forums is how to compute a moving average in SAS. This article shows how to use PROC EXPAND and contains links to articles that use the DATA step or macros to compute moving averages in SAS. In a previous post, I explained how to

The post Read more »

Tags: data analysis, Tips and Techniques, Uncategorized

Posted in SAS | Comments Off on Compute a moving average in SAS

A moving average (also called a rolling average) is a satistical technique that is used to smooth a time series. Moving averages are used in finance, economics, and quality control. You can overlay a moving average curve on a time series to visualize how each value compares to a rolling

The post Read more »

Tags: data analysis, Getting Started, Math, Uncategorized

Posted in SAS | Comments Off on What is a moving average?

Weighted averages are all around us. Teachers use weighted averages to assign a test more weight than a quiz. Schools use weighted averages to compute grade-point averages. Financial companies compute the return on a portfolio as a weighted average of the component assets. Financial charts show (linearly) weighted moving averages

The post Read more »

Tags: data analysis, Getting Started, Uncategorized

Posted in SAS | Comments Off on Compute a weighted mean in SAS

I wrote 114 posts for The DO Loop blog in 2015. Which were the most popular with readers? In general, highly technical articles appeal to only a small group of readers, whereas less technical articles appeal to a larger audience. Consequently, many of my popular articles were related to data

The post Read more »

Tags: data analysis, Uncategorized

Posted in SAS | Comments Off on Popular posts from The DO Loop in 2015

A SAS customer asked: Why isn't the chi-square distribution supported in PROC UNIVARIATE? That is an excellent question. I remember asking a similar question when I first started learning SAS. In addition to the chi-square distribution, I wondered why the UNIVARIATE procedure does not support the F distribution. These are

The post Read more »

Tags: data analysis, Statistical Thinking, Uncategorized

Posted in SAS | Comments Off on Why doesn’t PROC UNIVARIATE support certain common distributions?

Did you know that the FREQ procedure in SAS can compute exact p-values for more than 20 statistical tests and statistics that are associated with contingency table? Mamma mia! That's a veritable smorgasbord of options! Some of the tests are specifically for one-way tables or 2 x 2 tables, but many apply

The post Read more »

Tags: data analysis, Statistical Programming, Uncategorized

Posted in SAS | Comments Off on Exact tests in PROC FREQ: What, when, and how

Suppose that you are tabulating the eye colors of students in a small class (following Friendly, 1992). Depending upon the ethnic groups of these students, you might not observe any green-eyed students. How do you put a 0 into the table that summarizes the number of students who have each

The post Read more »

Tags: data analysis, Getting Started, Uncategorized

Posted in SAS | Comments Off on Tabulate counts when there are unobserved categories