Plant & Soil Sciences eLibraryPRO
Loading
control panel control panel
 

Analysis of Augmented Block Design Using R Part 2: Analyzing Treatments as Fixed Effects

Rate Me

R Packages

We have mentioned that to analyze the example data from Jennifer and data from Jayfred we will use a "Linear Mixed Model" in R. Once again, the linear mixed model refers to a model having both fixed and random effects where fixed effects are factors such that all possible levels are included in the study (experiment).  In contrast, in random effects only a subset of all possible levels of the factors are included in the study. 

Due to the fact that the standard installation of R natively (i.e. by default) does not include the ability to analyze linear mixed models, there is one additional step we must take before we begin. This involves adding the ability in R to be able to fit linear mixed models. This is a very simple step and can be accomplished by installing an additional "Package" to the R install on your computer. So let's understand what is the concept of the term "Package" in R. 

Defining the term "Package"

In general, software is developed with a core set of features (or functions) that are available to the user after the software is installed on their computer. Many times additional features (or functions) can be added to the software with the help of "Add On" that must be installed separately. This add on enhances the features and provides extended functionality to the existing software. On similar lines you can think about R Packages as collections of specialized R functions or features bundled together as an add on. A package can be installed on demand; a package also has a collection of data sets and function codes that are bundled within.

There are multiple packages available in R for one to install and use. These different packages bundle R functions that are specialized for a certain type of analysis in a field of science (and business, etc.). In order to use a package you must first install that package. Just like an add on, one particular type of R package only needs to be installed once on your computer. However every time you have to use one of these packages you must "load" them in your R session first (we will take a look at how to load the package later). 

One of a few R packages that we will use is called "Linear mixed-effects models using Eigen and S4 (lme4)". The documentation of the package in a PDF format is available at http://cran.r-project.org/web/packages/lme4/lme4.pdf and the summary is available at http://cran.r-project.org/web/packages/lme4/index.html.  Now we will demonstrate how to install this R package in the short clip below.

 

Presentation describing how to install a new Package in R , by Ashu Guru, University of Nebraska Raikes School (1 min)

[Download Video] (You may right click and save as)

 

 

In the above video we used the following command to install the lme4 package: 

install.packages("lme4")

To make sure you correctly understand what an R package is, and in particular, the one you need to fit linear mixed effect model, answer the following question.
 

Question : Install another R package called "lmerTest" on your computer. lmerTest is another package that we will use. Once installed answer the following:
** you may refer to R package "lmerTest" summary at: http://cran.r-project.org/web/packages/lmerTest/index.html 

In the package summary of lmerTest which of the following is NOT true:

 This package provides code for calculating population means for fixed factors with confidence intervals and corresponding plots.
 This package provides code for backward elimination of non-significant effects.
 The package provides code for  different kinds of tests on lmer objects (of lme4 package).
 This package fits linear and generalized linear mixed-effects models.


 

 

Comments

Be the first to write a comment...

Control Panel cancel

Create activities for your moodle courses. Moodle Go to moodle
Select and group e-Library Lessons to create your own package... My Communities
Community Blogs Community Media

My Joined Communities

 
My Blogs - a journal of my thoughts... My Blogs
 
My Comments - my thoughts expressed as a feedback... My Comments
 
Classes that I am taking Registered Classes
Class Blogs Class Media
 
Check the scores of assesments that you have taken Taken Assessments
 
clear
Please confirm your selection.