R-based statistics

EMEGS also offers the possibility to run factorial stastical test using R, more specifically a repeated measures ANOVA (using the aov-command from the standard stats package)  and  Mixed-Effect-Models (using the lme-command from the nlme-package).  Support for a multivariate analysis (using the anova.mlm-command from the standard stats package) with Huynh-Feldt- und Greenhouse-Geisser-Correction is in progress.



R-integration on Windows
All R-based analyses on Windows require R and R(D)COM-server  to be installed on your machine. Both can be downloaded at   http://www.r-project.org/.  Running an analysis using R differs from the matlab-based procedure exclusively in the start command: instead of usign the Run ANOVA-command from emegs3d-menu, choose Run ANOVA via R  or Run NLME via R. All other steps, including the definition of the factorial design, loading of required batchfiles and menu settings are identical to the procedure described on the anova page.



R-integration on Unix, Linux & MAC
R-based analyses on unix-like system (Unix,Linux and MAC) require R and Rserve and JRclient to be installed on your machine. R can be downloaded at http://www.r-project.org/Rserve can then be installed from within R using the command 


   
install.packages("Rserve")


You may need to have started R as root for this to work. This should compile and install Rserve. You can check whether Rserve is installed correctly by looking in the $RHOME/bin directory (e.g. /usr/lib/R/bin ) - there should be a file called Rserve. You can then start the server by typing


   
R CMD Rserve


or


    R CMD ./usr/lib/R/bin/Rserve


 in a shell/terminal (NEVER as root !!!!)  to start the server. You should get something like this:

R : Copyright 2003, The R Development Core Team

Version 1.7.0 Patched (2003-05-06)


R is free software and comes with ABSOLUTELY NO WARRANTY.

You are welcome to redistribute it under certain conditions.

Type `license()' or `licence()' for distribution details.


R is a collaborative project with many contributors.

Type `contributors()' for more information.


Type `demo()' for some demos, `help()' for on-line help, or

`help.start()' for a HTML browser interface to help.

Type `q()' to quit R.


Rserv started in daemon mode.


You can check whether Rserve runs with:

ps ax|grep Rserve


(or "ps -A|grep Rserve" depending on your unix). You should get something like this:

2822 ?? Ss 0:00.73 /usr/local/lib/R/bin/Rserve


The package JRclient can be downloaded (as the Rserve) from http://rosuda.org/Rserve/. Place the downloaded java archive file (named for instance JRclient-RF503.jar, depending on the current version) in the matlab java directory (e.g. /usr/lib/matlab7p1/java ) and add it's path to the matlab java classpath by typing


    edit classpath.txt


in the matlab command window and appending a line to the opened classpath-file with the full path to the java archive file, e.g.

   
    $matlabroot/java/JRclient-RF503.jar

You can then test the availability of the JRclient by typing


    test = org.rosuda.JRclient.Rconnection


in the matlab command window. If you get an error message, the package is not found. If it is found you get something like


test =
org.rosuda.JRclient.Rconnection@c492c8



Running an analysis using R differs from the matlab-based procedure exclusively in the start command: instead of usign the Run ANOVA-command from emegs3d-menu, choose Run ANOVA via R  or Run NLME via R. All other steps, including the definition of the factorial design, loading of required batchfiles and menu settings are identical to the procedure described on the anova page.