Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

STAT4601/STAT5703

Assignment #1

For assignment #1, you are to provide a professional report of all results, supported with the appropriate methodology (visualizations, association rule mining, etc.); it is to be in a format that you would submit to an employer; you may include appendices.

You are to provide all code you used to obtain your results and in a format that I can run to verify your results. I prefer that you do this assignment using R. Your files are to be labelled with your LastName FirstName.

A. Data Visualization Problem

Have you ever wondered how much sugar and fat goes into your favourite drink? Do you assume that food items from Starbucks are healthier than McDonald’s? You can check that by digging into the data. Below are datasets containing nutrition facts for menu items from both Starbucks and McDonald’s.

1. McDonald’s: The idea behind McDonald’s is to have a restaurant system known for food of consistently high quality and uniform methods of preparation. Franchisees and suppliers work for themselves, in a partnership with McDonald’s. Many of McDonald’s most famous menu items – like the Big Mac, Filet-O-Fish, and Egg McMuffin – were created by franchisees. The mcdonald menu.csv dataset (see Brightspace for data file) provides a nutrition analysis of every menu item on the US McDonald's menu, including breakfast, beef burgers, chicken and fish sandwiches, fries, salads, soda, coffee and tea, milkshakes, and desserts. The menu items and nutrition facts were scraped from the McDonald's website.

a. Provide visualizations and use them to answer the following:
i. How many calories does the average McDonald's value meal contain?
ii. How much do beverages, like soda or coffee, contribute to the overall caloric intake?
b. Refer to your visualization(s) to answer the following:
i. Does grilled chicken instead of crispy increase a sandwich's nutritional value?
ii. What about ordering egg whites instead of whole eggs?

c. What is the least number of items you could order from the menu to meet one day's nutritional requirements?

2. Starbucks: Starbucks is an American coffee chain, founded in Seattle, that serves both food and beverages.You have datasets in Brightspace that include the nutritional information for Starbucks’ food (starbucks-menu-nutrition-food.csv) and drink (starbucks_drinkMenu_expanded.csv) menu items. (Food composition data is in the public domain, but product names marked with ® or ™ remain the registered trademarks of Starbucks.) Using these sets of data, provide an easy-to-interpret visualization for the nutrition of each item.

3. FOR STAT5703 students only: Using visualization, compare the nutritional values of similar food and drink items to determine how Starbucks menu items compare to McDonald’s menu items in terms of nutrition.

B. Association Rule Mining

Knowledge of association rules mining can help to understand customers better and provide suitable strategies to boost sales. Some uses are:

a. Product arrangement: You may group related goods together or price combo items based on consumer purchasing habits.

b. Product recommendations: Product recommendations should be based on user purchasing habits. You may offer clients discounts if they buy more combinations. Alternatively, customers may purchase additional goods at a minimum total price.

c. Inventory Management: Market basket analysis becomes the basis for forecasting future purchases. Sales data is captured in real time, so maintaining product supply and controlling inventory becomes more efficient.

d. Optimize Ads Cost: Identify advertising opportunities. Customers’ reactions to messaging, communications, and offers reflect success of advertising campaigns.

The dataset bread_basket.csv in Brightspace is a dataset from a bakery (License: CC0: Public Domain). This dataset includes 20507 entries, over 9000 transactions, and 5 columns. Note that each row is an item that has been purchased. The column Transaction_Number tells you the unique id of the purchase. Set support =0.04 and find all rules with lift greater than 1.0. Interpret the rules you find.

NOTE: You will need to convert this data into a form that is useable by the arules package in R.

(The following article may assist you in doing this: https://www.learnbymarketing.com/1043/working-with-arules-transactions-and-read-transactions/ )