Welcome to homework 1! Before we get started, there are some quick things I would like to draw your attention to. First, to use this template, you will need to make sure you have already installed all R packages that are listed in the ‘master package R script,’ and also load-in the necessary packages below. Once packages are installed, please see below for how the structure of these homework assignments/files will be arranged!
All RMarkdown homework assignments will be structured in the same way! Please do not mess with the start of the templates! These are all set up a specific way for a reason!
First, there will always be a section showing you which packages you will need to load into your library for the assignment
Next, there will be a section to import the data that corresponds to the homework assignment (this is also downloaded from Canvas)
Following that, there will be a master list of the actual homework questions and their point values
To conclude, I will also have a reminder for turning in required documents.
Always start by loading in your various libraries. It is good practice to load all the packages in at the same time. This allows you to know exactly what is needed to reproduce your analyses. For this assignment, we will be working with the ‘psych’ package, but we will also need the other below packages to ensure our RMarkdown HTML file gets ‘knitted’ correctly!
For this assignment, this technically will be worth 1 point and is question #1. However, future assignments will require you to import data either via code or through the ‘import dataset’ point and click option and will not be worth points.
1. Import the raw dataset (“School1.csv”) into R using either syntax or the import dataset option discussed in lab. If you use the import dataset option, leave a comment that says you did. Make sure the name of the R dataset is “School1”. (1pt)
2. Check and call your working directory (.5pts)
3. Call the dataset to verify that the data are being properly read (.5pts).
4. Describe the variable “ACT” in the dataset using the ‘describe’ function in the psych package (1pt).
5. Describe the variable “HSGPA” in the dataset by “Gender” also using the psych package (1pt).
6. Change the level of “Gender” to a factor and give the levels of the factor names in the dataset. (1 = male; 2 = female) (2pts).
7. Run a basic frequency analysis of the variable “College.” Which school had the most people? (1pt)
8. Plot the “Race” variable using the base R ‘plot’ function (1pt).
9. Produce a scatterplot between ACT (x axis) and HSGPA (y axis). Make sure to include labels for the x and y axis, plot title, and a fit line (2pts).
You can write your responses directly into the Rmarkdown document, along with your code.
Which school had the most people? (Type your answer anywhere below)
I recommend ‘knitting’ your RMarkdown file before saving it, as this will automatically save the file for you anyways, and also ensure your RMarkdown HTML file is the most up to date. Again, don’t forget to upload BOTH the .html and .Rmd files in Canvas before midnight next Wednesday!
A work by Your Name Here