R-users: DRC package

Graham Ansell, an MSc ENVS student from the School of Environmental Studies, demonstrates the drc package in R.  He will introduce the package using an example pesticide mortality data (with limits of min 0 max 1).  A quick overview of the session will include:

  • Function section is for example of all possible models
  • “names” gives the variables in the model the proper names for most of them. Good resource, otherwise it’s just letters.
  • DRC is very good at comparing a range of models and is easy to use.  The drawback is that you cannot use a model more complex than “response ~ explanatory”,
    so no covariates or random variables allowed. If you need to incorporate other variables, look elsewhere.

To follow this session please install and load the DRC package.  The R script file used in the session is available here, complete with annotations.  You will also need the Excel data file used for the example.

Additional resources include the more drc examples and the drc help documentation.  These are also available through CRAN.

Name

R: How do you save your results?

One of the challenging things that I’ve been struggling with R, is how in the world do you save your results?  I learned the very basics of R-Markdown, which is one way to take your results and push them into a Word, PDF, or other type of document.  But are there other ways too?

For this session of our R-users meeting, I would like to hear how YOU save your results?  Do you copy and paste?  Do you screen shot it?  Do you retype pertinent pieces of the results?

If time and technology permits, I will show you what I have learned about R-Markdown, with the goal of holding a workshop this coming summer on this topic.

Hope to see you tomorrow, Friday, September 28 at 11:30 in Crop Science Rm 121A.

Name

Principal Component Analysis – SPSS, SAS, R

Many statistical procedures test specific hypotheses.  Principal Component Analysis (PCA), Factor analysis, Cluster Analysis, are examples of analyses that explore the data rather than answer a specific hypothesis.  PCA examines common components among data by fitting a correlation pattern among the variables.  Often used to reduce data from several variables to 2-3 components.

When running a PCA, you need to consider a couple of questions:  How many factors/components should be used, and how do you interpret the factors/components?

Before running a PCA, one of the first things you will need to do is to determine whether there is any relationship among the variables you want to include in a PCA.  If the variables are not related then there’s no reason to run a PCA.  The data that we will be working with is a sample dataset that contains the 1988 Olympic decathlon results for 33 athletes.  The variables are as follows:

run100m:  time it took to run 100m
longjump:  distance attained in the Long Jump event
shotput:  distance reached with ShotPut
highjump:  height reached in the High Jump event
run400m: time it took to run 400m
hurdles110m:  time it took to run 110m of hurdles
discus:  distance reached with Discus
polevault:  height reached in the Pole Vault event
javelin:  distance reached with the Javelin
run1500m:  time it took to run 1500m
score:  overall score for decathlon

Download the data in an excel spreadsheet here.

For this workshop we will conduct the same analysis in the 3 commonly used statistical packages:  SPSS, SAS, and R.  We will stat with SPSS then progress to SAS and finally to R.

If you are using SAS, please download the SAS program.

If you are using R, please download the R Script file.

Name

ARCHIVE: S18 R workshop

To complete the contents of this 2-day R workshop offered on May 22-23, 2018 we will work through the following sessions:

  1. R: Introduction to R and Definitions
  2. R: Introduction to RStudio and R packages
  3. R: Getting the data in, merging files, and creating new variables
  4. R: Cleaning and tidying data
  5. R: Getting comfortable with your data – Descriptive statistics, Normality, and Plotting
  6. R: ANOVA with an RCBD
  7. R: Correlation, Regression, and accompanying plots

To prepare for this workshop, please ensure that you have R and RStudio installed.  You can also prepare by installing the following packages before attending:

  • car
  • dplyr
  • ggplot2
  • lme4
  • readxl
  • stringr
  • tidyr
  • tidyverse