1 / 20

Introduction to

Introduction to. Alejandro Buren & Paul Regular. BIOL 7220 September 2012. 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.

more
Download Presentation

Introduction to

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introductionto Alejandro Buren & Paul Regular 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. 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,

  8. Functions • MANY built in functions • log() • exp() • sin() • sqrt() • mean() • max() • Etc.

  9. 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

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

  11. 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

  12. Statistics & Graphics • Working example • Look at data • Graph data • Run one regression and one ANOVA

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

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

  15. Possibilities... • Customized graphics... • Complex statistics...

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

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

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

  19. Fixed effects model Random effects model

More Related