# Posts Tagged ‘ Statistical Programming ’

## Video: A new syntax for lists in SAS/IML

June 8, 2018
By

I recently recorded a short video about the new syntax for specifying and manipulating lists in SAS/IML 14.3. This is a video of my Super Demo at SAS Global Forum 2018. The new syntax supports dynamic arrays, associative arrays ("named lists"), and hierarchical data structures such as lists of lists. [...] The post Video: A new syntax for lists in SAS/IML appeared first on The DO Loop.

## Random permutations without duplicates

April 16, 2018
By

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.

## Distance correlation

April 4, 2018
By

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.

## Find the distances between observations and a target value

March 28, 2018
By

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.

## Compute with combinations: Maximize a function over combinations of variables

March 19, 2018
By

About once a month I see a question on the SAS Support Communities that involves what I like to call "computations with combinations." A typical question asks how to find k values (from a set of p values) that maximize or minimize some function, such as "I have 5 variables, [...] The post Compute with combinations: Maximize a function over combinations of variables appeared first on The DO Loop.

## Fit a distribution from quantiles

March 7, 2018
By

Data analysts often fit a probability distribution to data. When you have access to the data, a common technique is to use maximum likelihood estimation (MLE) to compute the parameters of a distribution that are "most likely" to have produced the observed data. However, how can you fit a distribution [...] The post Fit a distribution from quantiles appeared first on The DO Loop.

## A Monte Carlo algorithm to estimate a median

February 21, 2018
By

This article describes and implements a fast algorithm that estimates a median for very large samples. The traditional median estimate sorts a sample of size N and returns the middle value (when N is odd). The algorithm in this article uses Monte Carlo techniques to estimate the median much faster. [...] The post A Monte Carlo algorithm to estimate a median appeared first on The DO Loop.

## Compute the quantiles of any distribution

February 19, 2018
By

Your statistical software probably provides a function that computes quantiles of common probability distributions such as the normal, exponential, and beta distributions. Because there are infinitely many probability distributions, you might encounter a distribution for which a built-in quantile function is not implemented. No problem! This article shows how to [...] The post Compute the quantiles of any distribution appeared first on The DO Loop.

## Use lists to pass parameters to SAS/IML functions

January 24, 2018
By

A popular way to use lists in the SAS/IML language is to pack together several related matrices into a single data structure that can be passed to a function. Imagine that you have written an algorithm that requires a dozen different parameters. Historically, you would have to pass those parameters [...] The post Use lists to pass parameters to SAS/IML functions appeared first on The DO Loop.

## Create lists by using a natural syntax in SAS/IML

January 22, 2018
By

SAS/IML 14.3 (SAS 9.4M5) introduced a new syntax for creating lists and for assigning and extracting item in a list. Lists (introduced in SAS/IML 14.2) are data structures that are convenient for holding heterogeneous data. A single list can hold character matrices, numeric matrices, scalar values, and other lists, as [...] The post Create lists by using a natural syntax in SAS/IML appeared first on The DO Loop.