# Welcome

We hope readers will take away three ideas from this book in addition to forming a foundation of statistical thinking and methods.

1. Statistics is an applied field with a wide range of practical applications.
2. You don’t have to be a math guru to learn from interesting, real data.
3. Data are messy, and statistical tools are imperfect. However, when you understand the strengths and weaknesses of these tools, you can use them to learn interesting things about the world.

## Textbook overview

This textbook accompanies the curriculum for STAT 216: Introduction to Statistics at Montana State University. The syllabus and other course information can be found on the course webpage. Detailed learning outcomes for the course can be found here.

1. Introduction to data. Data structures, variables, and basic data collection techniques.
2. Exploratory data analysis. Data visualization and summarization for one and two variables, with a taste of probability.
3. Correlation and regression. Visualizing, describing, and quantifying relationships between two quantitative variables.
4. Multivariable models. Descriptive summaries for quantifying the relationship between many variables.
5. Inference for categorical data. Inference for one or two proportions using simulation and randomization techniques as well as the normal distribution.
6. Inference for quantitative data. Inference for one or two means using simulation and randomization techniques as well as the $$t$$-distribution.
7. Inference for regression. Inference for a regression slope or correlation using simulation and randomization techniques as well as the $$t$$-distribution.

## STAT 216 Coursepack

Each week, you will work through an in-class activity with your team mates and the guidance of your instructor. These activities, as well as reading guides to guide you in taking notes on the required readings and videos, are included in the STAT 216 Coursepack. This course requires you to purchase a printed copy of the STAT 216 Coursepack and bring it with you to class each day.

The coursepack is available for purchase through the MSU Bookstore. You may purchase the coursepack in person, or you may purchase online and have the coursepack shipped to you. The coursepack will be available in the MSU Bookstore on the first day of classes. Chapter 1 of the coursepack is provided here if you do not have the coursepack by your first day of class.

## Statistical computing

STAT 216 and this textbook use R and RStudio for statistical computing. R and RStudio are free and open source. R is the programming language that runs computations, while RStudio is the interface in which you engage with R (called an “integrated development environment,” or IDE).

Since R is open source, users can contribute “packages” — collections of R functions. There are over 16,000 available packages! In particular, we use the tidyverse collection of packages designed for doing data science. STAT 216 also has its own R package called catstats, which contains all of the functions for running simulation-based inference in this course.

### Accessing RStudio

MSU hosts its own web based version of RStudio, which can be found at: rstudio.math.montana.edu.

2. Ensure that you are using the correct password that is associated with your NetID account. You can do this by logging into another site that requires your NetID (e.g., MyInfo) with the same credentials.

After you have tried all the steps above, if you continue to have issues logging in, please email Stat 216 Faculty Course Supervisor Dr. Stacey Hancock. You may also refer to the following section for other options for accessing RStudio.

Note that any work you save on the server will be deleted, and your access will be removed after the semester ends. Thus, if you would like to save any files, export them to your own computer prior to the end of the semester.

### Other options for accessing RStudio

We recommend using RStudio through the MSU RStudio server, but there are other options for accessing this free software:

1. Use RStudio through an MSU virtual machine. We highly recommend installing the VMware Horizon Client if you will be using the virtual machine regularly, as using it through a web browser runs the risk of losing your work if the browser disconnects from the system (which can happen for a number of reasons).

• Select the “MSU” domain (not “GFCMSU” or “MSUNORTHERN”).
• Upon logging in, select the “CLS-STAT-REMOTE” virtual machine. You will then see an RStudio icon on the virtual desktop.
2. Use RStudio on an MSU on-campus computer lab.

3. Use RStudio through the RStudio Cloud. This resource allows you to use RStudio through a web browser. It is free for use, but it does limit you to a certain number of project hours per month.

4. Download R and RStudio to your own laptop. (Note: R and RStudio will not run on iPad, notebooks, or Chromebooks.)

3. Install the catstats package.

View this tutorial video on installing R and RStudio if you would like additional installation instructions.

### Installing catstats

You only need to read this section if you are running RStudio on your own laptop, in which case you need to install the R packages used in this course.

To use the R functions in the catstats package, you need to first install the remotes package, and then install catstats from Github.

In the RStudio console, run the following commands:

install.packages("remotes")
remotes::install_github("greenwood-stat/catstats")

If during the installation, it gives you an option to update the more recent versions of packages, type 1 (to choose to install All), then type Yes if it asks if you want to install.

You only need to run the installation commands once, but you will need to load the catstats package each time you restart RStudio using the following command:

library(catstats)

Note that the catstats package will install all of the packages needed to run code in this textbook, so you will not need to load other packages (e.g., openintro) once you load catstats into your R session.

### Montana State University Authors

Nicole Carnegie
Associate Professor of Statistics

Stacey Hancock
Assistant Professor of Statistics

Elijah Meyer

Student Success Coordinator for Statistics

Melinda Yager
Assistant Coordinator for Statistics

### OpenIntro Authors

Mine Çetinkaya-Rundel

University of Edinburgh, Duke University, RStudio

Johanna Hardin

Pomona College

## Acknowledgements

This resource is largely a derivative of the 1st and 2nd editions of the OpenIntro textbook Introductory Statistics with Randomization and Simulation, without which this effort would not have been possible. The authors would also like to thank the Montana State University Library, who generously funded this project.

## Licensing

This resource is released under a Creative Commons BY-NC-SA 4.0 license unless otherwise noted.

Visit the following link for guidelines when the textbook’s source files are modified and/or shared, and for additional copyright information:

http://www.openintro.org/perm/stat2nd_v1.txt

To cite this resource please use:

Carnegie, N., Hancock, S., Meyer, E., Schmidt, J., and Yager, M. (2021). Montana State Introductory Statistics with R. Montana State University. https://mtstateintrostats.github.io/IntroStatTextbook/. Adapted from Çetinkaya-Rundel, M. and Hardin, J. (2021). Introduction to Modern Statistics. OpenIntro. https://openintro-ims.netlify.app/.