Posts Tagged ‘ Statistical Programming ’

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 »

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 »

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 »

Compute with combinations: Maximize a function over combinations of variables

March 19, 2018
By
Compute with combinations: Maximize a function over combinations of variables

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.

Read more »

Fit a distribution from quantiles

March 7, 2018
By
Fit a distribution from quantiles

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.

Read more »

A Monte Carlo algorithm to estimate a median

February 21, 2018
By
A Monte Carlo algorithm to estimate a median

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.

Read more »

Compute the quantiles of any distribution

February 19, 2018
By
Compute the quantiles of any distribution

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.

Read more »

Use lists to pass parameters to SAS/IML functions

January 24, 2018
By
Use lists to pass parameters to SAS/IML functions

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.

Read more »

Create lists by using a natural syntax in SAS/IML

January 22, 2018
By
Create lists by using a natural syntax in SAS/IML

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.

Read more »

10 posts from 2017 that deserve a second look

January 10, 2018
By
10 posts from 2017 that deserve a second look

Last week I wrote about the 10 most popular articles from The DO Loop in 2017. My most popular articles tend to be about elementary statistics or SAS programming tips. Less popular are the articles about advanced statistical and programming techniques. However, these technical articles fill an important niche. Not [...] The post 10 posts from 2017 that deserve a second look appeared first on The DO Loop.

Read more »


Subscribe

Email:

  Subscribe