GeoMinMOS {PracTools} | R Documentation |
Check geographic PSUs to determine whether any are less than minimum measure of size threshold
Description
Identify geographic PSUs whose measure of size is below a specified minimum and combine those PSUs with others
Usage
GeoMinMOS(lat, long, geo.var, MOS.var, MOS.min)
Arguments
lat |
latitude variable in an input file. Must be in decimal format. |
long |
longitude variable in an input file. Must be in decimal format. |
geo.var |
Geographic variable ID for grouping |
MOS.var |
Measure of size (MOS) for each PSU |
MOS.min |
Minimum allowed MOS value |
Details
GeoMinMOS
is a utility function that should be run after using GeoDistMOS
or GeoDistPSU
. GeoMinMOS
identifies each PSU whose measure of size, (MOS.var), is below the minimum specified by MOS.min
. Distances to the latitude/longitude centroids of other PSUs are calculated. The undersized PSUs are then combined with the nearest PSUs in proximity order until the minimum MOS is met or exceeded. In some cases, this can result in the same input PSU being assigned to more than one combined PSU. Also, the distances between the centroids of the PSUs in a combination may be impractically large. Thus, the new combinations generated by GeoMinMOS
should be treated as suggestions that should be manually reviewed and adjusted if desired.
Value
A list with four components:
Parameter.Information |
A data frame with three elements: |
Input.Information |
A data frame containing |
Geo.var.MOS.output |
A data frame with PSUs that were formed by combining undersized PSUs with adequately-sized PSUs. Columns in the data frame are: |
For.Review |
A list of the |
Author(s)
George Zipf, Richard Valliant
See Also
Examples
library(PracTools)
library(dplyr)
g <- GeoDistPSU(Test_Data_US$lat,
Test_Data_US$long,
"miles",
100,
Input.ID = Test_Data_US$ID)
Test_Data_US <- inner_join(Test_Data_US, g$PSU.ID, by=c("ID" = "Input.file.ID"))
GeoMinMOS(lat = Test_Data_US$lat,
long = Test_Data_US$long,
geo.var = Test_Data_US$psuID,
MOS.var = Test_Data_US$Amount,
MOS.min = 200000)