SAS

Blogs on the SAS software

How to get the current TITLE in SAS

December 13, 2017
By
How to get the current TITLE in SAS

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.

Read more »

A self-similar Christmas tree

December 11, 2017
By
A self-similar Christmas tree

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.

Read more »

3 problems with mean imputation

December 6, 2017
By
3 problems with mean imputation

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.

Read more »

Mean imputation in SAS

December 4, 2017
By
Mean imputation in SAS

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.

Read more »

Visualize patterns of missing values

November 29, 2017
By
Visualize patterns of missing values

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.

Read more »

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

November 27, 2017
By
The method of moments: A smart way to choose initial parameters for MLE

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…

Read more »

Compute the CDF and quantiles of discrete distributions

November 22, 2017
By
Compute the CDF and quantiles of discrete distributions

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.

Read more »

Simulate data from the beta-binomial distribution in SAS

November 20, 2017
By
Simulate data from the beta-binomial distribution in SAS

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.

Read more »

Catch run-time errors in SAS/IML programs

November 15, 2017
By
Catch run-time errors in SAS/IML programs

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.

Read more »

A tip for debugging SAS/IML modules: The PAUSE statement

November 13, 2017
By
A tip for debugging SAS/IML modules: The PAUSE statement

Debugging is the bane of every programmer. SAS supports a DATA step debugger, but that debugger can't be used for debugging SAS/IML programs. In lieu of a formal debugger, many SAS/IML programmers resort to inserting multiple PRINT statements into a function definition. However, there is an easier way to query [...] The post A tip for debugging SAS/IML modules: The PAUSE statement appeared first on The DO Loop.

Read more »


Subscribe

Email:

  Subscribe