In section, we will work to reinforce some of the statistical concepts and computations that are covered in lecture. For our first meeting, we will spend some time getting used to R Studio and getting to know each other.
For this class, you should be able to do the following:
To get to know each other, we’ll start by introducing ourselves. What I’d like you to do is get into small groups (3-4 people). I will give you 5 minutes to do the following:
After you complete this, I’ll ask you all to share what two things you’ve found in common.
Overall, we expect that section will be a time that you can learn additional information about the course material, clear up any misunderstandings, and gain a better grasp of R.
You will get the most out of section by actively participating. If I am going through a demonstration, it’s helpful for you to try it at your seats. If I am going too fast, please let me know or ask questions as they come up. During the practice components, you should try to actively solve the problems. It’s ok to say if you need more time.
Before our class starts, it’s important to set expectations for how we will work together. Let’s take some time to do this now. Some questions we should consider:
As psychologists, we use statistics to answer our research questions. We use statistical programs so that we do not have to compute statistics on large datasets by hand!
This semester, you will learn how to use the programming language, R, to analyze data. While there are many programs we could use, R has a few advantages:
You might be wondering why you’re learning to program in this class, particularly if you aren’t considering graduate school. Learning programming languages is applicable across a wide variety of careers and important skills like persistence, efficient problem solving, and critical thinking. Hand calculations do not facilitate these skills.
There are directions for how to do this posted on the Canvas site with videos (and hopefully you’ve had a chance to look at this.)
Because there are different ways and different errors that occur, we’ll take some time to make sure everyone is on the same page.
To download R: https://cran.r-project.org To download R Studio: https://www.rstudio.com Note you will need both of these for R Studio to work
If you have a Chromebook, you will need to use AppsToGo (unless you are comfortable using the terminal and Linux more generally.)
To use appstogo: https://apps.umn.edu/
We will be using the R Studio and R Markdown files (.Rmd) files because they will allow us to include both text and code in separate areas.
To use this, we need to understand what it looks like:
Top Left: R Markdown File: This is where you will answer questions and write code for R assignments. Make sure to save your work
Bottom Left: Console: This is a little like scrap paper. You can use this to try to answer questions or to write code. Scrap paper does NOT save when you exit out of R Studio This means we won’t be able to grade anything written in this section!
Top Right: Environment (and some other things): The top right section will be blank for now, but any variable you make or any data set you upload will be saved here.
Bottom Right: Everything else: There are several tabs you can open in this section. We’ll talk about them through class.
R Markdown Files are great because we can both type regular text and include areas that we will code in.
You will know that it worked because the background of the coding area will be another color.
#help!
"I got this"
## [1] "I got this"
We’ll use R to run a simple math equation. (Note: R follows order of operations for math, so make sure to use parentheses if you need to!)
3+4
## [1] 7
How do we get R to give us answers to our codes? We need to tell it to “run” our code. We can do this by selection “Run” in the tool bar underneath our R Markdown File name. We can also run code by putting our cursor on the line we want to run and pressing “Command(Mac)/Control(PC)” and “Return/Enter”.
Now we’ve got some of the basics! Next week, we’ll review these and add to our knowledge of R programming and data.