16 Recent Band Parents

# always begin by loading the disco engine if it isn't already loaded
library(discoveryengine)

A client in Student Affairs is considering organizing a weekend event for parents of marching band members who graduated recently. They are tentatively holding the event at the Claremont Resort, but want to be sure that there are enough recent band parents who live close enough to attend.

So our job is to build a definition of parents of recent band graduates who live near the Claremont Resort. Then we can just use display to view how many people fit the definition.

16.1 Recent band members

First I need to find out how to identify marching band members. I’ll use the brainstorm bot:

brainstorm_bot("marching band")
## participated_in 
##     MSMB: UC Marching Band Member

Cool. So definining “recent” as anyone who graduated between 2010 and 2016:

recent_band_member = participated_in(MSMB) %and%
    has_reunion_year(2010:2016)

16.2 Find their parents

Since I’m already familiar with higher order widgets, I know what to do here:

band_parent = parent_of(recent_band_member)

16.3 Who live close enough

Here I’ll assume that 25 miles is about as far as we can expect one of these band parents to travel in order to attend the event. So my definition should include only those people who live within 25 miles of the Claremont Resort:

event_prospect = band_parent %and% 
    lives_near("Claremont Hotel and Spa", miles = 25)
## Basing results on: The Claremont Hotel, Claremont Avenue, Oakland, Alameda County, California, 94720-1076, United States of America (37.8594, -122.242)

16.4 How many?

Now I just use display and see the number of parents:

display(event_prospect)
## # A tibble: 147 x 1
##    entity_id
##        <dbl>
##  1     13799
##  2     14999
##  3     15672
##  4     15687
##  5     29578
##  6     46204
##  7     50302
##  8    229795
##  9    250310
## 10    271059
## # … with 137 more rows

Notice the first line, before the IDs start, tells us exactly how many individuals are on the list: 147.

16.5 Householding

But hold up! Looking up some of these IDs, I’m noticing that both members of married couples are on the list. How many households are there here? I check the help for the display function by running ?display. And I notice that there is an option called household, and by default it is set to FALSE. So:

display(event_prospect, household = TRUE)
## # A tibble: 86 x 1
##    entity_id
##        <dbl>
##  1     13799
##  2     14999
##  3    229795
##  4    317956
##  5    347337
##  6    396274
##  7    766450
##  8    907499
##  9   3011819
## 10   3015961
## # … with 76 more rows