# Posts Tagged ‘ Uncategorized ’

## How to get the current TITLE in SAS

December 13, 2017
By

The SAS language is large. Even after 20+ years of using SAS, there are many features that I have never used. Recently it became necessary for me to learn about DICTIONARY tables in PROC SQL (and the associated SASHELP views) because I needed to programmatically obtain the text for the [...] The post How to get the current TITLE in SAS appeared first on The DO Loop.

## A self-similar Christmas tree

December 11, 2017
By

Happy holidays to all my readers! My greeting-card to you is an image of a self-similar Christmas tree. The image (click to enlarge) was created in SAS by using two features that I blog about regularly: matrix computations and ODS statistical graphics. Self-similarity in Kronecker products I have previously shown [...] The post A self-similar Christmas tree appeared first on The DO Loop.

## Always crashing in the same car

December 8, 2017
By
$Always crashing in the same car$

“Hey, remember me?  I’ve been busy working like crazy” – Fever Ray I’m at the Banff International Research Station (BIRS) for the week, which is basically a Canadian version of Disneyland where during coffee breaks a Canadian woman with a rake politely walks around telling elk to “shoo”. The topic of this week’s workshop isn’t […] The post Always crashing in the same car appeared first on Statistical Modeling, Causal…

## 3 problems with mean imputation

December 6, 2017
By

In a previous article, I showed how to use SAS to perform mean imputation. However, there are three problems with using mean-imputed variables in statistical analyses: Mean imputation reduces the variance of the imputed variables. Mean imputation shrinks standard errors, which invalidates most hypothesis tests and the calculation of confidence [...] The post 3 problems with mean imputation appeared first on The DO Loop.

## Mean imputation in SAS

December 4, 2017
By

Imputing missing data is the act of replacing missing data by nonmissing values. Mean imputation replaces missing data in a numerical variable by the mean value of the nonmissing values. This article shows how to perform mean imputation in SAS. It also presents three statistical drawbacks of mean imputation. How [...] The post Mean imputation in SAS appeared first on The DO Loop.

## Visualize patterns of missing values

November 29, 2017
By

Missing values present challenges for the statistical analyst and data scientist. Many modeling techniques (such as regression) exclude observations that contain missing values, which can reduce the sample size and reduce the power of a statistical analysis. Before you try to deal with missing values in an analysis (for example, [...] The post Visualize patterns of missing values appeared first on The DO Loop.

## The method of moments: A smart way to choose initial parameters for MLE

November 27, 2017
By

When you run an optimization, it is often not clear how to provide the optimization algorithm with an initial guess for the parameters. A good guess converges quickly to the optimal solution whereas a bad guess might diverge or require many iterations to converge. Many people use a default value [...] The post The method of moments: A smart way to choose initial parameters for MLE appeared first on The…

## Compute the CDF and quantiles of discrete distributions

November 22, 2017
By

A statistical programmer read my article about the beta-binomial distribution and wanted to know how to compute the cumulative distribution (CDF) and the quantile function for this distribution. In general, if you know the PDF for a discrete distribution, you can also compute the CDF and quantile functions. This article [...] The post Compute the CDF and quantiles of discrete distributions appeared first on The DO Loop.

## Simulate data from the beta-binomial distribution in SAS

November 20, 2017
By

This article shows how to simulate beta-binomial data in SAS and how to compute the density function (PDF). The beta-binomial distribution is a discrete compound distribution. The "binomial" part of the name means that the discrete random variable X follows a binomial distribution with parameters N (number of trials) and [...] The post Simulate data from the beta-binomial distribution in SAS appeared first on The DO Loop.

## Catch run-time errors in SAS/IML programs

November 15, 2017
By

Did you know that a SAS/IML function can recover from a run-time error? You can specify how to handle run-time errors by using a programming technique that is similar to the modern "try-catch" technique, although the SAS/IML technique is an older implementation. Preventing errors versus handling errors In general, SAS/IML [...] The post Catch run-time errors in SAS/IML programs appeared first on The DO Loop.