Installing R and Rstudio

Announcements

  • Fill Out Course Evaluations
  • Third Exam Next Week
    • 12 PM Class (Sec 01): Monday Math 12 10:30 AM to 12:30 PM
    • 1:30 PM Class (Sec 02): Wednesday May 14 1-3 PM

Statistics

Traditional Statistics

Traditional Statistics methods can conducted using either linear or logistic regression.

Visit Here for more information.

What is Statistics?

It is the study of variation and randomness!

What’s the goal of Statistics?

INFERENCE

Use our sample data to understand the larger population.

The data will tell us how the population generally behaves.

The data will guide us in the differences in units.

Data will tell us if there is a signal or just noise.

Final Thoughts

When conducting a study, literature review and study design are as equally important as statistics.

If you don’t see variability in the data, something is wrong.

Focus on consistency in the methodology, not consistency in data.

Understand that you can be wrong, and that is okay.

Don’t let data influence the methodology during a study/experiment.

Statistics Mantra

An image of George Box

All models are wrong,

some are useful!

Final Survey

Final Survey

Survery

Installation

Installing R

https://cloud.r-project.org/

Installing RStudio

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

Installing RTools (Windows)

https://cran.r-project.org/bin/windows/Rtools/

R Packages

Tidyverse

install.packages("tidyverse")

csucistats

install.packages('csucistats', 
                 repos = c('https://inqs909.r-universe.dev', 
                           'https://cloud.r-project.org'))

Other Packages

install.packages(c("ggthemes", "statmod", "car", "ggpubr", "lmtest", "rms", "palmerpenguins"))
csucistats::install_plots()
csucistats::install_themes()

Load Packages

library(tidyverse)
library(csucistats)
library(ggthemes)
library(waffle)
library(ggmosaic)
library(ggtricks)
library(ggtext)
library(ggpubr)
library(ThemePark)
library(car)
library(lmtest)
library(rms)
library(palmerpenguins)

RStudio Layout

RStudio Layout

  • Scripts

  • Console

  • Environment

  • Files

  • Everything else

Loading Data

Downloading Data Data

u1 <- "https://www.inqs.info/p/plotathon/owenWilsonWows.csv"
u2 <- "https://www.inqs.info/p/plotathon/owenWilsonWows.xlsx"

download.file(u1,
              file.path(getwd(), basename(u1)))
download.file(u2,
              file.path(getwd(), basename(u2)))