The problem set is worth 100 points.
Enter your answers in the empty code chunks.
Don’t change anything in the chunk below, and make sure you run it before attempting any of the problems:
library(tidyverse)
library(ggpubr)
set.seed(2018) # Belgium win 3rd place in the World Cup
(2+2)*(3(2)+5)/6/4
# your code here______________
Create a vector called “x” with the following values: 10, 15, 18, 20.
# your code here______________
Calculate the mean ( mean() ), median ( median() ) and standard deviation ( sd() ) of x .
# your code here______________
Draw two numbers from a standard normal distribution ( rnorm() ):
# your code here______________
Draw 100 numbers from a normal distribution with a mean of 7 and standard deviation of 4, and store the output in an object called “x1”:
# your code here______________
Draw 100 numbers from a normal distribution with a mean of 5 and standard deviation of 2, and store the output in an object called “x2”:
# your code here______________
Use data.frame() to combine x1 and x2 into a data frame called “df”:
# your code here______________
Use the $ indexing method to calculate: the mean of the first column of df :
# your code here______________
the standard deviation of the second column of df :
# your code here______________
Use head() to print the first 3 rows of df :
# your code here______________
Let’s work with the data set diamonds :
data(diamonds)
head(diamonds)
Calculate the average price of a diamond:
# your code here______________
Use group_by() to group diamonds by color, then use summarise() to calculate the average price and the standard deviation in price by color:
# your code here______________
Use group_by() to group diamonds by cut, then use summarise() to count the number of observations by cut:
# your code here______________
Use filter() to remove observations with a depth greater than 62, then use group_by() to group diamonds by clarity, then use summarise() to find the maximum price of a diamond by clarity:
# your code here______________
Use mutate() and log() to add a new variable to the data called “log_price”:
# your code here______________
Continue using diamonds .
Use geom_histogram() to plot a histogram of prices:
# your code here______________
Use geom_density() to plot the density of log prices (the variable you added to the data frame):
# your code here______________
Use geom_point() to plot carats against log prices (i.e. carats on the x-axis, log prices on the y-axis):
# your code here______________
Use stat_summary() to make a bar plot of average cut: Same as above but change the theme to theme_classic() :
Finally,
create a bar plot for average color and assign it to the object “plot_color”;
create a scatter plot for depth against log pricse (depth on x-axis, log prices on y-axis) and assign it to the object “plot_depth”;
use ggarrange from ggpubr to combine plot_color and plot_depth into a single plot with automatic labels.
Use t.test() to test the following hypothesis on log price:
:
=8
:
=8
Use lm() to estimate the model
and store the output in an object called “m1”:
# your code here______________
Use summary() to view the output of “m1”:
# your code here______________
Use lm() to estimate the model and store the output in an object called “m2”:
# your code here______________
Use summary() to view the output of “m2”:
# your code here______________
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme