Download presentation

Presentation is loading. Please wait.

Published byReese Bardy Modified over 2 years ago

1
Alejandro Buren & Paul Regular Introduction to BIOL 7220 September 2012

2
What to expect from this workshop Intro to R Data summaries Create plots Run General linear models Easily extensible to glm, gam, glmm, gamm – BUT you have to know what you’re doing

3
What NOT to expect from this workshop A course in statistics A showcase of R’s capabilities

4
What is R? Environment and language for – Statistics – Graphics – Etc. Open source

5
Why use R? It’s FREE! Flexible One stop shop Large up-front cost, but BIG payoff Growing number of users Expansive!

6
Download & Install Program – R & Tinn-R installed? Packages – Required to use statistical and graphical packages not included in the base package – Install once – Load each new session

7

8
Vectors R has symbolic vectors which can be assigned values The traditional way to do this in R is the ’<-’ operator Possible vector names flexible – Vector names cannot start with a digit – Names are case-sensitive – Some common names are already used by R c, q, t, C, D, F, I, T,

9
Functions MANY built in functions – log() – exp() – sin() – sqrt() – mean() – max() – Etc.

10
Data Types Vectors (Numeric, Character, Logical) Matrix – All columns in a matrix must have same mode Array – N-dimensional matrix Dataframe – Columns in a data frame can have different modes. Similar to SAS and SPSS datasets Lists – Collection of objects, can be different modes and dimensions Factor

11
Data Management Import & Export Useful functions – subset – na.omit – cbind, rbind – sort – summaryBy – Operate over dataframe – Random numbers

12
Good Practice Set up a working directory Comment on each line of code Avoid attach function Define parameters in first lines of code Use standard format use.dots, OrCapitals, avoid spaces anywhere Clean up

13
Statistics & Graphics Working example – Look at data – Graph data – Run one regression and one ANOVA

14
HELP! Useful websites – Official site (http://www.r-project.org/)http://www.r-project.org/ Manuals found on this site (http://cran.r-project.org/manuals.html)http://cran.r-project.org/manuals.html – R search site (http://finzi.psych.upenn.edu/search.html)http://finzi.psych.upenn.edu/search.html – Quick-R (http://www.statmethods.net/index.html)http://www.statmethods.net/index.html – R graphics gallery (http://addictedtor.free.fr/graphiques/)http://addictedtor.free.fr/graphiques/ Books – The R Book – Etc. List serve ?function

15
Useful Packages...for us Statistical – VEGAN – lme4 – gam – nnet – Rcmdr Graphical – lattice – Rcmdr – gplots Data management – RODBC – doBy – reshape

16
Possibilities... Customized graphics... Complex statistics...

17
t-test ANOVA Simple Linear Regression Multiple Linear Regression ANCOVA GENERAL LINEAR MODELS ε ~ Normal R: lm()

18
t-test ANOVA Simple Linear Regression Multiple Linear Regression ANCOVA Poisson Binomial Negative Binomial Gamma Multinomial GENERALIZED LINEAR MODELS Inverse Gaussian Exponential GENERAL LINEAR MODELS ε ~ Normal Linear combination of parameters R: lm() R: glm()

19
t-test ANOVA Simple Linear Regression Multiple Linear Regression ANCOVA Poisson Binomial Negative Binomial Gamma Multinomial GENERALIZED LINEAR MODELS Inverse Gaussian Exponential Non-linear effect of covariates GENERALIZED ADDITIVE MODELS GENERAL LINEAR MODELS ε ~ Normal Linear combination of parameters R: lm() R: glm() R: gam()

20
Fixed effects modelRandom effects model

Similar presentations

© 2016 SlidePlayer.com Inc.

All rights reserved.

Ads by Google