saeplus_prepdata: Prepare geospatial data for small area estimation

View source: R/saeplus_prepdata.R

saeplus_prepdataR Documentation

Prepare geospatial data for small area estimation

Description

This function checks for consistency of the shapefiles, boundary level files, survey data and geospatial data prior to the small area estimation modelling

Usage

saeplus_prepdata(
  hhsurvey_dt,
  hhid_var,
  adminshp_dt,
  hhgeo_dt,
  hhcoords,
  geosurvey_mergevars,
  adminvars = c("ADM1_NAME", "ADM1_CODE", "ADM2_NAME", "ADM2_CODE", "ADM3_NAME",
    "ADM3_CODE"),
  geopolycensus_dt,
  target_id = "ADM3_CODE",
  crs_set = rep(4326, 4),
  agr_set = rep("constant", 4),
  drop_chars = TRUE
)

Arguments

hhsurvey_dt

geocoded household survey data (use st_as_sf() to create geometry column if not available needed

hhid_var

household ID variable within the hhsurvey_dt object

adminshp_dt

data.frame/data.table/sf object with administrative boundaries defined

hhgeo_dt

an sf/data.table/data.frame containing household latitude and longitude

hhcoords

a character string of length 2 for the longitude and latitude variables (respectively) in

adminvars

list of every admin name and admin code pair in order (e.g c("ADM1_NAME", "ADM1_CODE", "ADM2_NAME", "ADM2_CODE", ...))

geopolycensus_dt

an object of class sf, data.table and/or data.frame containing polygon/multipolygon geometries and geospatial indicators

target_id

a character string representing a column vector in hhsurvey_dt for the admin level at which small area estimates will be computed for the poverty map

crs_set

an integer list of the coordinate reference systems for of the aforementioned objects i.e. the CRS for hh_dt, adminshp_dt and geopolycensus_dt in this order

agr_set

a character/string list representing attribute-geometry-relationships specified for each non-geometry attribute column and how it relates to the geometry, and can have one of following values "constant", "aggregate" and "identity". The default is constant. See details for more. The AGR will listed in the same order as the crs_set.

drop_chars

if TRUE, characters (usually country ISO3) in the admin level names and codes will be dropped. The admin level codes must be integers for the emdi::ebp function to work.

Value

a list of geospatial objects for household, synthetic census and a check of the administrative level info


SSA-Statistical-Team-Projects/SAEplus documentation built on Aug. 24, 2022, 11:26 a.m.