A Very Brief Introduction To R: - Matthew Keller
A Very Brief Introduction To R: - Matthew Keller
- Matthew Keller
2. Profile analysis (withinsubject MANOVA) on dataset that
included twins violation of independence assumption!
So we needed to permute the independent variable within families
for one analysis and within individuals for another.
Do this 10000 times and save results after each to get valid p
values
R Commercial packages
Many different datasets (and other One datasets available at a given
“objects”) available at same time time
Datasets can be of any dimension Datasets are rectangular
Functions can be modified Functions are proprietary
Experience is interactive-you Experience is passive-you choose
program until you get exactly what you an analysis and they give you
want everything they think you need
One stop shopping - almost every Tend to be have limited scope,
analytical tool you can think of is forcing you to learn additional
available programs; extra options cost more
and/or require you to learn a different
language (e.g., SPSS Macros)
R is free and will continue to exist. They cost money. There is no
Nothing can make it go away, its price guarantee they will continue to exist,
will never increase. but if they do, you can bet that their
prices will always increase
R vs SAS/SPSS
R vs SAS/SPSS
R vs SAS/SPSS
There are over 800 add-on packages
(http://cran.r-project.org/src/contrib/PACKAGES.html)
• This is an enormous advantage - new
techniques available without delay, and they
can be performed using the R language you
already know.
• Allows you to build a customized statistical
program suited to your own needs.
• Downside = as the number of packages grows,
it is becoming difficult to choose the best
package for your needs, & QC is an issue.
A particular R strength: genetics
• Bioconductor is a suite of
additional functions and
some 200 packages
dedicated to analysis,
visualization, and
management of genetic
data
• Much more functionality
than software released by
Affy or Illumina
An R weakness
• Structural Equation Modeling - the sem
package is quite limited.
• But this will
not be a weakness
for long…
Typical R session
• Start up R via the GUI or favorite text editor
• Two windows:
– 1+ new or existing scripts (text files) - these will be saved
– Terminal – output & temporary input - usually unsaved
Typical R session
• R sessions are interactive
x1 x2 x3 x4 x5 x6
1
2
3
Z <- 4
5
6
7
8
R Objects
x1 x2 x3 x4 x5 x6
1
2
The MODE of Z is
3 determined automatically
4
5
by the types of things
6 stored in Z – numbers,
7
8
characters, etc. If it is a
mix, mode = list.
R Objects