Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please use R or R studio to solve the following: Suppose we have the two customer groups profiles as below. What is the average offline
Please use R or R studio to solve the following:
Suppose we have the two customer groups profiles as below. What is the average offline spending for the customer group A who match all of the following conditions? What is the average offline spending for the customer group B who match all of the following conditions? Which group of customers spend more in the offline store on average? Suppose the dataset is called sales. How would you code the following to get results?
Customer group As profile
- Age >= 20
- Living in Normal
- Female
- Customers who posted reviews
- Customers who live more than 10 miles (> 10) away from the store
- Customers who never returned products through offline store
Customer group Bs profile
- Age < 35
- Income < 85000
- Loyalty level = low
- Living in Bloomington
- Customers who live within 40 miles (<= 40) from the store
- Customers who never visited online store
- Customers who purchased products through offline store at least once
age | city | sex | distance.to.store | online.visits | online.trans | online.spending | online.return | offline.trans | offline.spending | offline.return | review | income | loyalty | |
12 | yes | bloomington | female | 0.91 | 353 | 117 | 832.58 | 0 | 2 | 26.51 | 0 | yes | 70538.3 | high |
23 | yes | normal | female | 15.35 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | no | 72254.83 | low |
37 | yes | bloomington | female | 47.48 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | no | 74205.44 | high |
22 | yes | bloomington | female | 2.28 | 40 | 8 | 68.32 | 0 | 2 | 50.48 | 2.67 | yes | 72210.13 | med |
38 | yes | bloomington | female | 19.23 | 80 | 32 | 236.48 | 0 | 1 | 15.88 | 0 | yes | 73914.73 | high |
34 | yes | bloomington | female | 1.22 | 6 | 0 | 0 | 0 | 5 | 57.92 | 0 | no | 73819.08 | low |
16 | yes | bloomington | female | 2.85 | 0 | 0 | 0 | 0 | 1 | 12.22 | 0 | no | 72262.31 | med |
23 | yes | normal | female | 2.97 | 7 | 4 | 29.97 | 0 | 0 | 0 | 0 | no | 72180.03 | med |
31 | yes | normal | female | 60.51 | 19 | 4 | 27.9 | 0 | 1 | 11.87 | 0 | yes | 73813.56 | high |
33 | no | normal | female | 72.98 | 2 | 1 | 9.13 | 1.46 | 0 | 0 | 0 | no | 73500.6 | low |
25 | yes | bloomington | female | 14.76 | 9 | 2 | 14.49 | 0 | 2 | 19.67 | 0 | no | 72654.17 | med |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started