• Biostatistics
  • Goal of this WebBook
  • Academic Integrity
  • Zoom links
  • Lecture 1: Introduction
  • Tutorial 1: The R environment
  • Lecture 2: Statistical Hypothesis Testing
  • Tutorial 2: Statistical Hypothesis Testing
  • Lecture 3: Stat. Hyp. Testing - part 2
  • Reference Search
  • Lecture 4: Estimators and Factorial ANOVA
  • Lecture 5: Factorial ANOVA part 2
  • Tutorial 3: Factorial ANOVA
  • Lecture 6: Post-Hoc Tests
  • Lecture 7: Non-parametric tests
  • Tutorial 4: Multiple Testing
  • Lecture 8: Heteroscedasticity
  • Lecture 9: ANCOVA
  • Tutorial 5: Rank-transformation and Heteroscedasticity
  • Lecture 10: Types of Sum of Squares
  • Lecture 11: Multiple regression
  • Tutorial 6: ANCOVA
  • Lecture 12: Multiple regression part 2
  • Lecture 13: Multiple regression part 3
  • Tutorial 7: Multiple regression in practice
  • Lecture 14: A new look into Heteroscedasticity
  • Tutorial 8: Heteroscedasticity and GLMs
  • Lecture 15: Mixed models part 1
  • Lecture 16: Mixed models part 2
  • Tutorial 9: Mixed models - part 1
  • Lecture 17: Mixed models part 3
  • Lecture 18: Machine Learning - K-means
  • Tutorial 10: Mixed models - part 2
  • Lecture 19: Machine Learning - trees
  • Lecture 20: PCA part 1
  • Tutorial 11: Machine Learning
  • Lecture 21: PCA part 2
  • Lecture 22: Multivariate Response Models
  • Tutorial 12: PCA and RDA
  • Published with bookdown

Advanced Statistics for Biological Sciences - BIOL422 & BIOL680 - 2025

Zoom links

This doesn’t apply to this version of the course.

4# Installing R & RStudio {-}


Why should you use R?
by Greg Martin, Health Service Executive (Ireland)

You will need two components to run R in our tutorials. The first is the R software itself, which provides the programming environment and core functions; and the other is RStudio, which offers a user-friendly interface for coding, data visualization, and debugging.

The computer rooms used for tutorials are equipped with R and RStudio. However, installing these programs on your personal computer may facilitate work on course assignments, including course reports. Note also, that other computer rooms at Loyola may be equipped with R and RStudio.

To download R and RStudio for MacOS and Windows, you can use the link below:

https://posit.co/download/rstudio-desktop/

R and RStudio for Mac - Installation steps

In the link above, you will first install R and after it’s installed, you will install RStudio (in that order). Once you click the “Download and Install R” banner in the link above, you will be offered three options:

Download R for Linux (Debian, Fedora/Redhat, Ubuntu) Download R for macOS Download R for Windows

If you’re using a Mac, select “Download R for macOS.” This will take you to a page with several options. You need to know whether your Mac has an M1, M2 or M3 or an Intel processor. If you’re unsure, click the Apple icon in the top-left corner of your screen, select “About This Mac,” and then “More Info.” This will display the type of Mac you have.

For Apple Silicon (i.e., from M1, M2, or M3 processor) Macs (newer Macs - not Intel), click on the first option, “R-4.4.1-arm64.pkg”, to begin the download.

For older Intel Macs (but still very commonly used), click on the second option, “R-4.5.2-x86_64.pkg”, to begin the download.

Click either link to download the package file (.pkg). After downloading, open the file and follow the installation instructions.

Next, go back to the RStudio download page at https://posit.co/download/rstudio-desktop/ and install RStudio. The website will automatically select the appropriate package file (.pkg) based on your operating system. Once the download is complete, open the downloaded file and follow the on-screen instructions to complete the installation.

R and RStudio for Windows 10 or above - Installation steps

Obs: for older Windows versions, talk to your instructor, Dr. Pedro Peres-Neto.

To download R and RStudio for Windows, go to the same page as before: https://posit.co/download/rstudio-desktop/

In the link above, you will first install R and after it’s installed, you will install RStudio (in that order). Once you click the “Download and Install R” banner in the link above, you will be offered three options:

Download R for Linux (Debian, Fedora/Redhat, Ubuntu) Download R for macOS Download R for Windows

If you’re using a Windows machine, select “Download R for Windows.” This will take you to a page with several options. Click the link in the first option labelled base with the text at the end “This is what you want to install R for the first time.”

The link will take you to a new link “Download R-4.5.2 for Windows (87 megabytes, 64 bit)” at the top of the page. Click to begin download if you have Windows 10 or greater (older versions talk to the instructor). After downloading, open the downloaded file and follow the installation instructions.

Next, go back to the RStudio download page at https://posit.co/download/rstudio-desktop/ and install RStudio. The website will automatically select the appropriate package file (.pkg) based on your operating system. Once the download is complete, open the file and follow the on-screen instructions to complete the installation.