Your name: Sidney Parkent
Before submitting, publish your results to rpubs. RPubs URL: ________________________
Load the Christmas budget data from the provided Excel file. Fix the code below.
Create a chart
Show the distribution of holiday budget with a histogram Properly label the chart, and apply formatting to the x axis Add an outline to each data bar so you can see where it stops / starts against its neighbors. Add a caption with your judgement on if this data would be appropriate as a dependent variable in linear regression.
Be sure to not have any warnings printed
Create a chart that shows each city’s density against its holiday budget. For full credit, also encode information on population in the chart.
Be sure to not have any warnings printed
Use linear regression to predict holiday budget. Be sure to only use valid predictors Output the results of the model, as well as put your analysis below.
#Visualize
pairs(select(t_joint, holiday_budget, population, density))
cor(select(t_joint, holiday_budget, population, density))
holiday_budget population density
holiday_budget 1 NA NA
population NA 1 NA
density NA NA 1
#graph
ggplot(data = t_joint) +
geom_smooth(mapping = aes(x = population, y = holiday_budget,
method = 'lm',
se = FALSE))
Warning: Ignoring unknown aesthetics: method and se
#training data
trainIndex <- t_joint (t_joint$holiday_budget, p=0.8, list=FALSE, times=1)
Error in t_joint(t_joint$holiday_budget, p = 0.8, list = FALSE, times = 1) :
could not find function "t_joint"