Category: SAS


How to Read a SAS Dataset Into R – The Right Way

|

The problem: while packages for reading in SAS datasets into R exist, they do not many formats, especially custom formats. Hence, a user must manually enter those in R. This becomes particularly onerous with survey datasets involving custom Likert scales. Solution: SAS-R scripte. This handy script from an anonymous contributor generates R code to set… Read More

Equivalent of SAS Macros in R – Loops and Functions by Courtney Gale

|

If you’re an avid SAS user, you’re likely very familiar with SAS macros. SAS macros are a key component to creating efficient and concise code. Although you cannot use macros in R, R offers other features like functions and loops that can perform the same tasks as SAS macros. Using apply() to loop over variables… Read More

A SAS Macro/R Code Comparison: Generating Multiple Datasets by Tristan Hayes

|

This is a short comparison of SAS and R code in the context of generating multiple datasets. In this example, the mpg dataset from R is used to show how one might use a SAS Macro to subset the data by car class, followed by the R equivalent. You will see that in SAS, the macro… Read More

A Quick Recommendation on SAS Setup at UT by Fridtjof Thomas

|

This is a quick guide on the recommended SAS setup for UT users. This is excerpted from a longer guide on software setup and windows 10. SAS 9.4 TSIM3 Large (16GB) download from UT Knoxville This download will take several hours due to its size (zipped file 16GB).  You may want to ask the Biostatistics… Read More