Meet the toolkit

Lecture 2

Dr. Elijah Meyer

NC State University
ST 511 - Fall 2024

2024-08-21

Checklist

– Are on you Slack? (118 have joined as I make these slides)

– Can you access R + RStudio?

– Have you completed the Getting to know you survey?

   Located on Moodle

   Due Wedesday (today) at 11:59 pm

   Quizzes can not be late

   Free points + help me know you!

– Have you uploaded today’s activity to RStudio?

   Try is before class starts

   We will demo this again today

   If you can not upload it, work with your neighboor and talk to me after class

Warm up

Are each of these variables categorical or quantitative?

– Price of a home

– Zip code

– Student’s letter grade

Warm up

  • Price of a home

    • Quantitative
  • Zip code

    • Categorical
  • Student’s letter grade

    • Categorical

Warm up

What is an explanatory variable? What is a response variable?

Warm up

  • Explanatory variable: Is the variable researchers manipulate or observe changes in that might influence or have an impact the response variable. THis is also called the independent variable

  • Response variable: THis is the variable researchers are interested in. Also called the dependent variable,

Warm up

What does reproducibility mean? Why is it important in research?

Warm up

Reproducibility: Running the same analysis and getting to the same result.

“Quarto is an open-source software project that aims to make reproducible research and publications the norm.”

Crisis in Science

(Baker, 2016)

Quarto

– an open-source scientific and technical publishing system

– publish high-quality articles, reports, presentations, websites, blogs, and books in HTML, PDF, MS Word, ePub, and more

How will we use Quarto?

– Every AE, Hw, and take-home exam will be given to you as a Quarto document.

– You will always have a Quarto template document to start with

– We will create HTML / PDF documents

Goals for today

Basics we will use throughout the semester

  • R and RStudio
  • Quarto Documents
  • Practice

What is R and RStudio?

– R is a statistical programming language

– RStudio is a convenient interface for R

R layout

Some R essentials

Functions are (normally) verbs, followed by what they will be applied to in parentheses:

Packages

– Packages are extensions of “base R” that contains code, functions, and data sets we can use!

– The tidyverse package is a collection of R packages.

The pipe

|> is called a pipe operator

This is used to emphasize a sequence of coding actions

“and then”

The pipe

The pipe

In summary

– We use Quarto for reproducibility

– We use R + RStudio for statistical analyses, data visualizations, and numerical summaries

– Functions are useful, and are pre-packaged code that help us operate on a dataset

– A code chunk argument is used to control rendered output in a document

– We can use the pipe |> for a sequence of actions

Checklist

– Join Slack

– Complete the quiz due tonight on Moodle

– Look out for prepare material for Monday

– Ask questions!