SAS

Blogs on the SAS software

The sweep operator: A fundamental operation in regression

April 18, 2018
By
The sweep operator: A fundamental operation in regression

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.

Read more »

Random permutations without duplicates

April 16, 2018
By
Random permutations without duplicates

A colleague and I recently discussed how to generate random permutations without encountering duplicates. Given a set of n items, there are n! permutations My colleague wants to generate k unique permutations at random from among the total of n!. Said differently, he wants to sample without replacement from the [...] The post Random permutations without duplicates appeared first on The DO Loop.

Read more »

Find the unique rows of a numeric matrix

April 11, 2018
By
Find the unique rows of a numeric matrix

Sometimes it is important to ensure that a matrix has unique rows. When the data are all numeric, there is an easy way to detect (and delete!) duplicate rows in a matrix. The main idea is to subtract one row from another. Start with the first row and subtract it [...] The post Find the unique rows of a numeric matrix appeared first on The DO Loop.

Read more »

Taking in. Giving back.

April 9, 2018
By
Taking in. Giving back.

When we breathe, we breathe in and breathe out. If we choose only one or the other, the results are disastrous. The same principle applies to professional growth and development. Whether we are programmers, statisticians, teachers, students, or writers, we benefit from taking in and giving back. We "take in" [...] The post Taking in. Giving back. appeared first on The DO Loop.

Read more »

Distance correlation

April 4, 2018
By
Distance correlation

Correlation is a statistic that measures how closely two variables are related to each other. The most popular definition of correlation is the Pearson product-moment correlation, which is a measurement of the linear relationship between two variables. Many textbooks stress the linear nature of the Pearson correlation and emphasize that [...] The post Distance correlation appeared first on The DO Loop.

Read more »

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

April 2, 2018
By
The chi-square test: An example of working with rows and columns in SAS

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…

Read more »

Using Excel for Data Entry

March 28, 2018
By

This article shows you how to enter data so that you can easily open in statistics packages such as R, SAS, SPSS, or jamovi (code or GUI steps below). Excel has some statistical analysis capabilities, but they often provide incorrect answers. For … Continue reading →

Read more »

Find the distances between observations and a target value

March 28, 2018
By
Find the distances between observations and a target value

Suppose you want to find observations in multivariate data that are closest to a numerical target value. For example, for the students in the Sashelp.Class data set, you might want to find the students whose (Age, Height, Weight) values are closest to the triplet (13, 62, 100). The way to [...] The post Find the distances between observations and a target value appeared first on The DO Loop.

Read more »

A zipper plot for visualizing coverage probability in simulation studies

March 26, 2018
By
A zipper plot for visualizing coverage probability in simulation studies

Simulation studies are used for many purposes, one of which is to examine how distributional assumptions affect the coverage probability of a confidence interval. This article describes the "zipper plot," which enables you to compare the coverage probability of a confidence interval when the data do or do not follow [...] The post A zipper plot for visualizing coverage probability in simulation studies appeared first on The DO Loop.

Read more »

The conjugate gradient method

March 21, 2018
By
The conjugate gradient method

I often claim that the "natural syntax" of the SAS/IML language makes it easy to implement an algorithm or statistical formula as it appears in a textbook or journal. The other day I had an opportunity to test the truth of that statement. A SAS programmer wanted to implement the [...] The post The conjugate gradient method appeared first on The DO Loop.

Read more »


Subscribe

Email:

  Subscribe