Skip to main content

Lab 4 — Customer Research

Introduction

We've been asked to assist with filtering a large set of market research data to identify potential customers for a clothing brand. We've been given a record containing a customer's age, zipcode, and yearly income.

Problem 1

Design a function young-customers that filters only the customers who are under 30 years old.

Problem 2

INTERPRETIVE QUESTION

Imagine a political action group wants to share advertisements on YouTube with voters of a certain political party. Although YouTube users don't explicitly share their political affiliation, YouTube could feasibly analyze a user's watch history to determine their political affiliation and target ads accordingly.

This is the idea of data inference: using one or many pieces of information to infer some other piece of information. Data inference tools are being marketed for hiring employees, detecting shoppers' moods, and predicting criminal behavior (https://www.nytimes.com/2019/04/21/opinion/computational-inference.html).

Carefully consider our customer data. What might we be able to infer about our users with this data? In 2-3 sentences, explain how that assumption could be problematic.

Problem 3 (binning)

Design a function income-category that takes a row and returns a string representing the income category: "low" for incomes below $40,000, "middle" for incomes between $40,000 and $80,000, and "high" for incomes above $80,000. Then, use build-column to add this categorization to the table.

Problem 4

Create a function marketing-summary that generates a summary table showing the count of customers in each combination of age group ("under 25", "25-35", "over 35") and income category ("low", "middle", "high"), which will help the marketing team target their campaigns.