550R Intro Lab 4 (v2)

.pdf

School

Eastern University *

*We aren’t endorsed by this school

Course

550

Subject

Statistics

Date

Jan 9, 2024

Type

pdf

Pages

2

Uploaded by BrigadierIceWombat39

Report
DTSC 550: Intro to Statistical Modeling R Intro Lab 4 For this assignment, you must name your R file rintro04.R To make a new file: RStudio File New File R Script After calculating basic statistics by hand in this module (Content Module 2: Statistics & Probability Basics Descriptives Descriptive Statistics Practice Problems), we will calculate basic descriptive statistics using R. First, install and import the library ggplot2. (If you forget how to install and import libraries: Content Module 1: Introduction to R & Statistics R Introduction Packages) After installing and loading the ggplot2 package, we will use the pre-loaded txhousing dataset. The txhousing dataset contains the monthly housing sales in Texas by city, from 2000 to 2015. See here for more information. Before the exercises, play around with it. Take a good look and get familiar with it. You can view txhousing like this: Q1: Calculate the mean of the volume variable using the mean function without parameters. Assign it to Q1 . To access one variable of the dataset, use the $ operator, for example: txhousing$volume . The official R documentation must be our first resource of documentation. Here is the mean documentation. https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/mean For the next questions, we strongly suggest you go through the documentation of each function. Q2: Calculate the mean of the volume again. This time, use the parameter na.rm = TRUE . Assign it to Q2 . Compare Q1 and Q2. Ask yourself: What has changed? What is the difference?
Q3: Calculate the median of the listings variable. Assign it to Q3 . Use what you have learned with the Q1 vs. Q2 comparison. Q4: Assign the min value of volume to Q4. Q5: Assign the max value of volume to Q5. Q6: Calculate the range of the volume . Assign it to Q6. (Hint: Use Q4 and Q5) Q7: Calculate the variance of the year variable. Assign it to Q7 . Q8: Calculate the standard deviation of the volume variable. Assign it to Q8 . Q9: Using the summary function, create the summary of the txhousing dataset. Assign it to Q9 . Q10: Consider the first row of our dataset: Calculate the z-score of the volume of this observation (row). Assign it to Q10 . What does this z-score tell you about this observation?
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help