SPSS, SAS or R…which one to choose?

A very interesting post!

FreshBiostats

Performing statistical analyses by hand in the era of new technologies would seem crazy.  Nowadays, there are three main statistical programs for doing statistics: IBM SPSS, SAS  and R, as it can be read in a more extensive post of this site. Sometimes, biostatisticians need to use more than one package to carry out their analyses.  This means that users of these programs have to move from one to another environment, from front-end to back-end, using different wizard and graphical interfaces, wasting in most occasions an important amount of time. Because of that, in this post I would like to address the differences between the aforementioned programs, pointing out the advantages and the most suitable usage of each software from my personal point of view.

For a good choice of a statistical program, one should take into account several issues such as the following:

1. Habit: It refers to how…

Ver la entrada original 576 palabras más

Anuncios

…about R, for beginners

These days I was remembering my beginnings as a linux user few years ago, and how I found R (possibly in a very unlikely way: searching for a SPSS alternative in Linux). For two years, R had been almost impossible for me. I didn’t understand its syntax (I don’t have programming background), and luckily I had installed R Commander (Rcmdr) to perform simple analysis and plots…

Another feature of Rcmdr (that I didn’t use) was that every click to a button remains in a part of Rcmdr’s console, and then it can be copied, used and modified. Indeed, the ‘copypaste‘ thing has revealed to me as the best way to acquire, recyle, modify and run commands.

Have you installed R? You can try this (nice) code:

# First we store an object called ‘object’ in R’s memory (just like a big calculator)

object <- seq(1,100,  by=5)

# ‘Object’ stores the sequence (seq) from 1 to 100, by 5. That is: 1,  6, 11, 16, 21 26, 31… If you type ?seq in the console, you will have a brief help.

# With R, you can calculate big numbers, logarythms and fractions storing its components, with less chance of errors than with an ordinary calculator.

# You can create new variables from old ones:

logobject <- log10(object)

# ‘Logobject’ stores the decimal logarythm of every value inside ‘object’. That is:

logobject

# You can also plot the variables with simple functions like plot:

plot(object)

plot(object, logobject)

plot(object, logobject, col = "red", xlab="My X axis", ylab= "This is my Y axis", main="My first plot")

# As you can see, is not very difficult to change the color “argument”, from “red” to “green” or “blue” for instance. The title, instance of “My first R plot” can be changed to “My coloured R plot”, or the labels of the axes. Don’t forget to store these commands and new ones, in a plain Text document, Wordpad etc.. so you can recycle them and fix syntax errors!

# If you feel confident, you can try this. The spoiler is here, by DWin

dat <- data.frame(t=seq(0, 2*pi, by=0.1) )

xhrt <- function(t) 16*sin(t)^3

yhrt <- function(t) 13*cos(t)-5*cos(2*t)-2*cos(3*t)-cos(4*t)

dat$y = yhrt(dat$t)

dat$x = xhrt(dat$t)

with(dat, plot(x,y, type="l"))

with(dat, polygon(x,y, col="hotpink"))