Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write an R Function oblem 2: Revenue for X Co Retail In the archive for this lab is the SQLite database xcoretail.sqlite discussed in class.

Write an R Function

image text in transcribedimage text in transcribed

oblem 2: Revenue for X Co Retail In the archive for this lab is the SQLite database xcoretail.sqlite discussed in class. For each month in the range January 2011 to August 2011 (inclusive), calculate X Co Retail's total revenue for that month. Provide code, and plot the revenue by month (your y-axis can be 1 , 2,3, instead of dates, but make sure to label the axes clearly with units). A description of the database follows. This database has two tables: sales and prices. The table sales contains one row for each sale that the company made during the reporting period. The table prices has three columns: StockCode a string indicating the product identifier. Quantity an integer indicating how much product was sold. InvoiceDate a string indicating the date of the sale. The table prices is a column indicating the price of each product in the company's inventory and has four columns: StockCode a string indicating the product identifier (matching the identifiers in the table sales. Description a string describing the product. UnitPrice the price in USD of the product. (4 points) Bonus problem: Improving X Co Retail SOP a) Improve the ad-hoc method that X Co Retail employs to predict demand for a product in the next month. In particular, write a function so that if a product code and a target month (for example product code '71053' and month '2011-05') are provided, then a regression is done on the monthly total quantity sold for the 3 months before the target. (You may use the code provided in the Making the 'printout' slide of Lecture 05 as a starting point.) The function then returns a prediction for the target month, according to the OLS fit. Provide some short instructions on how to use your function, and examine plots for some product code/month pairs. Does your exploration suggest that rolling out this procedure on all product codes may be indicated? Why, or why not

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases And Information Systems 1 International Baltic Conference Dbandis 2020 Tallinn Estonia June 19 2020 Proceedings

Authors: Tarmo Robal ,Hele-Mai Haav ,Jaan Penjam ,Raimundas Matulevicius

1st Edition

303057671X, 978-3030576714

More Books

Students also viewed these Databases questions

Question

What is electric dipole explain with example

Answered: 1 week ago

Question

Finding and scheduling appointments with new prospective clients.

Answered: 1 week ago