Basics of R

Data import and manipulation, graphs, functions, modeling
R. Condit
Ohio State University Department of Music
May 2013

Assignments

Tuesday, 7 May

  1. Write a script to manipulate studyOneCleanData
  2. Write a script to manipulate study3Opera

Wednesday, 8 May

  1. Regression: —– data

Thursday, 9 May

  1. Write a function to do regression, draw graph, add line
    1. Arguments x, y
    2. Save graph
    3. Loop through several x variables
  2. Write a function with a loop

Friday, 10 May

  1. Use lmer for regression of logagb on logdbh with species and forest type as factors
    1. Include squared term for logdbh
    2. Add locality as a group effect (does it change the fixed effect)
    3. Test forest type as fixed effect and as group effect
    4. Graph points and lines
    5. Compare alternative models
  2. Use lmer for regression of pup Wt on momcat with year as a mixed effect
    1. Variable intercept, slope, or both
    2. Graph all points
    3. Use xyplot for groups (Lattice)
    4. Overlay lines of all random effects
    5. Compare alternative models
  3. Use lmer for regression of log(ht) on log(dbh) with species as a mixed effect