Showing posts with label SAS. Show all posts
Showing posts with label SAS. Show all posts

How to import SAS data set into R

at 07 November 2007

The import of data into R is still a bit complicated if the original data are stored in the SAS-data format. Though solutions have existed for a long time, see e.g. the R-documentation concerning Importing from other statistical systems, it is complicated to use these facilities. They are based on functions which need to call the SAS-program from R. The settings for doing this do not always correspond to the settings on the computers we use.

I have written a short note/web-page with focus on the export problem from the SAS point of view. The note compares three different intermediate formats: csv, xls and xport format.

In normal use, the route via the xls format seems best. Data are exported via SAS code similar to:

 
libname sasdata "C:/SASImport";
libname out Excel
"C:/SASImport/file798b12e1.xls";
data out.rimporttest;
set sasdata.rimporttest;
run;

and imported into R via the read.xls command in the xlsReadWrite package.


Further detail in the note, which also includes R-functions. The note is also available as a pdf-file

R for SAS and SPSS users

at 02 May 2007

I came across this document - RforSAS&SPSSusers.pdf - which gives a nice R-introduction to people familiar with other statistical packages. It might be of use in connection with various courses.

Data and program examples from SAS for Mixed Models

at 09 March 2007

In our current mixed model course we use the book SAS for Mixed Models, Second Edition by Ramon C. Littell, George A. Milliken, Walter W. Stroup, Russell D. Wolfinger, and Oliver Schabenberger



This is the first time we use the 2nd edition of the book. The changes in the second edition includes extensive use of the output delivery system (ODS) and examples using e.g. PROC NLMIXED and PROC GLIMMIX rather than the glimmix macro used in the 1st edition.


Participants in our previous courses might be interested in updating the file with program and data examples. It can be downloaded from the companion page above. The link to the file is a little different to find on the page, so you may just follow this link to program examples and data

Fejl i SAS

at 17 January 2007

Både SAS version 8.2 og 9.1.3 laver forkerte beregninger, når man har mere end een random sætninger hvor covarians har: type=sp(...)

Der finde opdateringer til begee versioner af SAS:


Hotfix for V9:
http://ftp.sas.com/techsup/download/hotfix/e9_win_sbcs.html#e9st05
Hotfix for V8:
http://ftp.sas.com/techsup/download/hotfix/82_win_sbcs.html#82ST19

For at installere Hotfix for vesion 9 skal man først installeres Sevicepack 4
(http://ftp.sas.com/techsup/download/hotfix/e9_win_sbcs.html#e9h004)

Jeg har bedt om at få dette rettet på Linux, men det er p.t. endnu ikke gjort.

SASweave - writing LaTeX docs and SAS (and R) code together

at 12 January 2007

A looooong time ago I wrote a small package allowing combining LaTeX, SAS and R into one document. I never took the work any further than the first version...

Russ Lenth from Iowa found it on the Web and he has now created a fully functional program called "SASweave" (see the link) - mainly for working with SAS and LaTeX together, but it is also possible to use it additionally with R code. We are currently writing a little paper about the program, so any input/comments/experiences from you will be appreciated. Currently I am using it when preparing the lecture slides etc. for out mixed model course in Spring 2007. It works fairly well - if I may say so...

Using the SQLite database in connection with SAS and R

at 03 January 2007

I have made this small document which explains how to set up an SQLite database and use it from both SAS and R. Working with SQLite is very easy. Comments will be appreciated; I guess the document could be of use in connection with our teaching.