• Home
  • Blog
  • University of Connecticut Create a Program Code R Coding Task

University of Connecticut Create a Program Code R Coding Task

0 comments

# READ ALL INSTRUCTIONS #

##############################################################################

# Write the codes and run them to get the correct answers

# You will NOT need to imput the answers into Canvas,

# **Therefore make sure you include detailed answers in the R script as a comment**

# A few questions only require the code, they are labeled as such

# However, any required answers that are missing or lack detail will result in a loss of points

# Any code that is missing will also result in a loss of points

#############################################################################

# install packages if needed first

# call these libraries

library(dplyr)

library(ggplot2)

library(tidyverse)

library(moments)

# Download the data from the link below, it is names ames

# Description of data is given here: https://www.openintro.org/stat/data/ames.php

download.file(“http://www.openintro.org/stat/data/ames.RData”, destfile = “ames.RData”)

load(“ames.RData”)

# 1. Find the names of the variables. (only include code)

# 2. How many observations are there in the data? How many variables?

# 3. attach your data (only include code)

# 4.Find the first 4 rows of the SalePrice column in the ames data matrix. (only include code)

# 5. What is the class of SalePrice?

# 6. What is the class of Heating.QC?

############################

#Now use SalePrice as your variable.

# 7. What is the average sale price of the houses?

# 8. Find the summary statistics of sale price (only include code)

# 9. Comment on median and mean sale price after running #8. Are they different? Why they might be different? What does it tell you about the data?

# 10. What is the 3rd quantile of the sale price? Explain what does that number mean?

# 11. What is the range of the sale price?

# 12. Get the histogram of the sale price. What do you observe? Comment.

########################

# Let’s assume the sale price is nearly normally distributed with a mean of $180 thousand and

#standard deviation is $80 thousand.

# 13. What is probability that a house price will be less than $150 thousand?

# 14. What is probability that a house price will be greater than $250 thousand?

# 15. What is the probability that the sale price is between $150,000 and 250,000 ?

# 16. Which sale price is the cutoff value corresponding to top 10% ?

# 17. According to the normal distribution rule, what percentage of the sale price will be in

# 1 standard deviation interval? How about 2 standard deviation interval. (code not required for this question)

About the Author

Follow me


{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}