Skip to contents

Identifies and reports which (if any) lower-level administrative units overlap the boundaries of top-level administrative units.

There identification and adjustment is crucial if the user is interested in top-level fixed effects. Otherwise a BSU cluster could be assigned to 2 municipalities simoultaniously.

The function takes any jointly estimated key from EtE_changes() and returns a list object.

Usage

check_overlap(df_key)

Arguments

df_key

A data.frame: Only the joint data.frame from this package can be processed.

Value

A 'list' object, with four 2 elements candidates, details

  • candidates - a vector with the low-level cluster id that overlap

  • details - a data frame with a detailed overview

    • Gcluster_id - low-level cluster id that overlaps

    • Ccluster_id_1 - First top-level cluster assigned to

    • Ccluster_id_2 - Second top-level cluster assigned to

    • Cname_1 - name of First top-level cluster

    • Cname_2 - name of Second top-level cluster

Examples

df_key_join <- NGeoTrack::df_key_join
expl <- check_overlap(df_key = df_key_join)
#> Error in loadNamespace(x): there is no package called ‘tidyr’

expl$candidates
#> Error in eval(expr, envir, enclos): object 'expl' not found
# [1] 100124 100125 100016 100373

expl$details
#> Error in eval(expr, envir, enclos): object 'expl' not found
# Gcluster_id Ccluster_id_1 Ccluster_id_2 Cname_1     Cname_2
#    <int>         <int>         <int> <chr>       <chr>
# 100124           528           529  Østre Toten   Vestre Toten
# 100125           528           529  Østre Toten   Vestre Toten
# 100016        500023          1911  Sortland      Kvæfjord
# 100373           704        500016  Tønsberg      Sandefjord