Question: Use R for each question. Please submit your word / pdf document and your R - script to Canvas. Run library ( tidyverse ) before
Use R for each question. Please submit your wordpdf document and your Rscript to Canvas.
Run librarytidyverse before attempting the questions.
Question Time Trends
Download the dataset called Stock Price on Canvas, import it into R
Hint: You can do this manually, or use these codes arrange the dictionary accordingly:
libraryreadxl
Stock Price read excelDesktopStock Price.xlsx
ViewStock Price
Understanding the dataset:
a Explain the dataset: What are the variables in the dataset? How is the time variable constructed day hour etc
What is the time period captured in this dataset? What is the minimum price? What is the maximum price?
b Draw a graph of price against time, where price is on the yaxis and time is on the xaxis.
Linear time trend model:
c Construct a linear time trend model: pricet beta beta times time ut
Call this model model linear. What does the estimate for the time variable in the linear regression model represent?
How would you interpret its value in the context of the stock price data we are analyzing? Is the estimate for the time
variable significant at the level?
d Do part b again, but this time fit a linear regression line to the scatter plot. By looking at this graph only, what
initial insights can you draw regarding the adequacy of the fitted model in capturing the relationship between stock prices
and time? Report the time periods where the model is likely to overpredict or underpredict the stock prices you dont need
to give overly specific time ranges
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
