This function builds a data set containing the number of individuals that remain in their home location (stay) or travel to another location during the time span of the survey. The output is designed to provide data for the fit_prob_travel function. The admin unit used to aggregate the travel/stay counts depend on the arguemtns supplied:

  1. When data_pred is supplied and agg_adm = NULL, the lowest admin unit of data_pred is used

  2. When both data_pred and agg_adm are NULL, the lowest admin unit of data is used

get_stay_data(data, data_pred = NULL, agg_adm = NULL)

Arguments

data

generalized data frame described in travel_data_sim or derivative thereof

data_pred

generalized data frame containing the admin units at which to predict probability of travel

agg_adm

optional argument (logical) giving an arbitarary admin unit over which to aggregate travel/stay counts

Value

dataframe with same columns as travel_data_sim data with columns for counts of travel/stay/total

See also

Other data synthesis: get_crossdist(), get_distance_matrix(), get_mob_matrix()

Other travel probability: fit_prob_travel()

Author

John Giles

Examples

stay_data <- get_stay_data(travel_data_sim, agg_adm=2)
#> Added missing unique location names.
#> Using total trip count method