Mathematical Transformations of Numeric Variables - SAS Programming

Suppose you have a SAS data set (HOSP)which contains LOS (length of stay) and PROP (proportion of the time spent in bed).Many hospital patients spend a relatively short time (about a week) in the hospital, but there are some patients who spend several months or more.

To compare length of stay among different treatments or diagnoses,some statistical tests require that something be done with the extreme values (called outliers).(Actually, when the variable in question is AGE,we have outliers and outright liars.) One way to "pull in" distributions of variables like length of stay is to take the logarithm of the value and use this in the analysis.With this in mind, let's assume that you want to create two new variables.

One will be the natural (base e) logarithm of LOS; the other, a popular transformation of a proportion called the arcsine square-root x transform.This latter transformation involves first taking the square-root of a value, and then taking the arcsine of the result. Here is the SAS code:



All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

SAS Programming Topics