# Posts Tagged ‘ Getting Started ’

## The sweep operator: A fundamental operation in regression

April 18, 2018
By

The sweep operator performs elementary row operations on a system of linear equations. The sweep operator enables you to build regression models by "sweeping in" or "sweeping out" particular rows of the X`X matrix. As you do so, the estimates for the regression coefficients, the error sum of squares, and [...] The post The sweep operator: A fundamental operation in regression appeared first on The DO Loop.

## The chi-square test: An example of working with rows and columns in SAS

April 2, 2018
By

As a general rule, when SAS programmers want to manipulate data row by row, they reach for the SAS DATA step. When the computation requires column statistics, the SQL procedure is also useful. When both row and column operations are required, the SAS/IML language is a powerful addition to a [...] The post The chi-square test: An example of working with rows and columns in SAS appeared first on The…

## How to use FIRST.variable and LAST.variable in a BY-group analysis in SAS

February 26, 2018
By

My article about the difference between CLASS variables and BY variables in SAS focused on SAS analytical procedures. However, the BY statement is also useful in the SAS DATA step where it is used to merge data sets and to analyze data at the group level. When you use the [...] The post How to use FIRST.variable and LAST.variable in a BY-group analysis in SAS appeared first on The DO…

## The difference between CLASS statements and BY statements in SAS

February 14, 2018
By

When I first learned to program in SAS, I remember being confused about the difference between CLASS statements and BY statements. A novice SAS programmer recently asked when to use one instead of the other, so this article explains the difference between the CLASS statement and BY variables in SAS [...] The post The difference between CLASS statements and BY statements in SAS appeared first on The DO Loop.

## What is rank correlation?

August 14, 2017
By

When someone refers to the correlation between two variables, they are probably referring to the Pearson correlation, which is the standard statistic that is taught in elementary statistics courses. Elementary courses do not usually mention that there are other measures of correlation. Why would anyone want a different estimate of [...] The post What is rank correlation? appeared first on The DO Loop.

## The IFN function versus the IF-THEN/ELSE statement in SAS

June 7, 2017
By

I have previously discussed how to define functions that safely evaluate their arguments and return a missing value if the argument is not in the domain of the function. The canonical example is the LOG function, which is defined only for positive arguments. For example, to evaluate the LOG function [...] The post The IFN function versus the IF-THEN/ELSE statement in SAS appeared first on The DO Loop.

## A simple trick to construct symmetric intervals

April 10, 2017
By

Many intervals in statistics have the form p ± δ, where p is a point estimate and δ is the radius (or half-width) of the interval. (For example, many two-sided confidence intervals have this form, where δ is proportional to the standard error.) Many years ago I wrote an article [...] The post A simple trick to construct symmetric intervals appeared first on The DO Loop.

## LEAVE and CONTINUE: Two ways to control the flow in a SAS DO loop

March 15, 2017
By

SAS programmers who have experience with other programming languages sometimes wonder whether the SAS language supports statements that are equivalent to the "break" and "continue" statements in other languages. The answer is yes. The LEAVE statement in the SAS DATA step is equivalent to the "break" statement. It provides a [...] The post LEAVE and CONTINUE: Two ways to control the flow in a SAS DO loop appeared first on…

## An easy way to run thousands of regressions in SAS

February 13, 2017
By

A common question on SAS discussion forums is how to repeat an analysis multiple times. Most programmers know that the most efficient way to analyze one model across many subsets of the data (perhaps each country or each state) is to sort the data and use a BY statement to [...] The post An easy way to run thousands of regressions in SAS appeared first on The DO Loop.

## ODS OUTPUT: Store any statistic created by any SAS procedure

January 9, 2017
By

In the beginning SAS created procedures and output. The output was formless and void. Then SAS said, "Let there be ODS," and there was ODS. Customers saw that ODS was good, and SAS separated the computation from the display and management of output. The preceding paragraph oversimplifies the SAS Output […] The post ODS OUTPUT: Store any statistic created by any SAS procedure appeared first on The DO Loop.