class: center, middle, inverse, title-slide .title[ # Statistics and Quantitative Methods (S1) ] .subtitle[ ## Week 3 — Workshop ] .author[ ### Dr Stefano Coretta ] .institute[ ### University of Edinburgh ] .date[ ### 2022/10/04 ] --- # Update the sqmf package Time to update the sqmf package (if you haven't already)! Run the following in the console: ``` r remotes::install_github("stefanocoretta/sqmf") ``` --- # The data analysis pipeline .center[ ![](../../img/eda.png) ] ??? Week 2 was dedicated to "Visualise". Week 3 is about "Transform" and "Model". "Import" and "Tidy" will be dealt with later on. --- # Transform These are the main **transformation** operations: <br> - `fiter()`: Filter data based on specific columns. For example, get data from L2 participants only. - `mutate()`: Add new columns (or modify existing columns) based on operations applied to other columns/data/etc. - `count()`: Count occurrences in the data based on the values of one or more columns. --- # Model We will focus on modelling data using **linear models**. - A linear model: ```r lm_1 <- lm(price ~ carat, data = diamonds) ``` - Model the relationship between `carat` and `price`. - `carat` is a **predictor variable** ans `price` is the **outcome variable**. - In this linear model, both the outcome and the predictor variables are **continuous**. ??? **Outcome variable** - The variable to the left of `~`. - Also known as *dependent variable*. **Predictor variable(s)** - The variable(s) to the right of `~`. - Also known as *independent variable*. --- class: middle center inverse .f1[TUTORIALS] ??? You can run tutorials also from the console! `learnr::use_tutorial("03a_transform", "sqmf")` `learnr::use_tutorial("03b_lm_basics", "sqmf")`