[R] Are you experienced in SAS ...

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Sat Nov 24 13:25:01 CET 2001

Rolf Turner <rolf at maths.uwa.edu.au> writes:

> I'd just like to put in my two bob's worth:
> The ***only*** thing for which I prefer SAS to R/Splus, but it's
> a very important thing, is the analysis of mixed linear models.
> One can do the same analyses in both languages.  The difference is
> that the SAS syntax for specifying such a model, and its output, is
> comprehensible to the human mind, which is what I'm equipped with.
> The R/Splus syntax (which involves the bewildering notion of
> ``strata'') is not.

Not the sort of thing to make Doug and Jose happy. They've probably
heard these sentiments before, though.

But... There's an important difference between the two
implementations, exactly in the area of strata. These are BTW really
just "levels" in the sense of multilevel models (pupils within classes
within schools within municipalities within countries, etc.) and their
explicit specification makes some block-diagonal matrix optimizations
possible. For largish data sets, you will find that SAS loses out
efficiency-wise, because it doesn't do these optimizations.

In some cases, the model formula notation tends to cause complexity
that might seem unnecessary. The most conspicuous case is when you add
a traditional variance component that goes "across" the stratification
and need to do something like this (for a person*bread*time unbalanced
three-way layout)


in which the pdIdent(form=~time-1) is essentially caused by the fact
that model formulas were really designed for systematic effects that
are unchanged under contrast parametrizations, whereas random effects
are not. Thus to specify the model you have to know what the design
matrix looks like for a given model formula, and select the formula so
that the covariance structure you put on the random coefficients makes
sense. It is quite convoluted, but I think I can assure you that a
substantial amount of though went into the design of this.

   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list