Estimating Market Size
Alex Cory
Est-Market-Area.Rmd
Estimating Market Size
Market size is based on market area and market population. The market size is needed in order to estimate the number of shoppers the store will bring in.
Market Area
Market area is estimated by identifying the nearest grocery store to the address input by the user in each quadrant. A list of the nearest grocery stores from the address input by the user comes from the Google Places API. Our program is able to pull from the Google Places API to find the nearby stores, but it only gives us the latitude and longitude of each of the stores, not a distance, and not a direction. This function takes the data frame from the API call and figures out which direction each of the stores is in, and returns the nearest store in each quadrant. GPS coordinates are converted to UTM in order to filter our data frame into cardinal quadrants to find the nearest store in each direction. In order to find distance to each store, the Haversine equation is being used. This is a method used to find distance between two GPS coordinates while factoring in the curvature of the Earth. The distances between the user input address and the nearest grocery stores are calculated and the nearest store in each quadrant give us the radius of a quarter circle. We half the radius to account for the market area of the other store, then the area for each quarter circle is then calculated and summed to give us a total area in square meters.
The county that the address falls within is identified by the
County_Identifier()
function. Then the area in meters is
pulled from Tigris. A percentage representing market area (summed
quarter circle area) divided by the total area of the county.
Market Population
The four main components that make up the estimated market population are County, Metro, Cities, and Rural Populations.
- County population is defined as the population of the county the town is in. It is found by a TidyCensus call for the county.
- Metro population is defined as the population of the town the store is in. It is estimated by parsing the city name from the address input by the user and then filtering a data frame with all cities in that county’s populations to find only the town with the store. - Cities population is defined as the population of the cities within the market area. It is estimated by finding the population of all the cities in the market area using Tigris. - Rural population is defined as the population in the market area but outside of any towns. It is estimated by subtracting the towns population from the county population and multiplying it by the percentage of the county covered in the market area.