[R] Getting started with R

Jonathan Baron baron at cattell.psych.upenn.edu
Tue Jan 15 19:25:42 CET 2002


I think our "Notes on R for psychology..." was written just
for you.  I believe it has examples much like the ones you
describe.  (It is a little out of date because it has not been
revised to keep up with newer versions of R ... yet.)

Your particular problems might be solved with by(), or
apply(), or tapply().  It is a little hard for me to tell
because I'm not sure how you've laid out your data.  In
particular, there is no code for subject, yet you say it
is a within-subject design.

For your second example, if you have data for many subjects
(not clear from your description), you might try things in
the mva package.  The biplot function for principal
components is particularly nice.  You might want to put
the data into a one-row-per-subject matrix or data-frame,
in both cases (although the layout you seem to have has
other advantages, as we explain).

Our notes are in the contributed documents section, and at
http://finzi.psych.upenn.edu
and thre is also a reference card in both places (also a
little out of date - mostly needing a second page for
graphics).

As for your question about whether to use one code for each
condition or 1-3 to indicate conditions, either is good, but
you probably want to make the 1-3 code a _factor_, which is
what is sometimes called a categorical variable.

Jon Baron
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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