multistrat: Performs Block Kriging for Multiple Strata Separately

Description Usage Arguments Value Examples

View source: R/multistrat.R

Description

Runs slmfit, predict, and FPBKoutput for each stratum in a user-specified stratification variable. Note: if fitting the spatial model separately for each stratum, then stratum cannot be included as a covariate in the formula argument.

Usage

1
2
3
4
multistrat(formula, data, xcoordcol, ycoordcol, CorModel = "Exponential",
  coordtype = "TM", estmethod = "REML", covestimates = c(NA, NA, NA),
  detectionobj = NULL, detinfo = c(1, 0), areacol = NULL,
  FPBKcol = NULL, stratcol = NULL)

Arguments

formula

is an R linear model formula specifying density as the response variable as well as covariates for predicting densities on the unsampled sites.

data

is the data set with the response column of densities, the covariates to be used for the block kriging, and the spatial coordinates for all of the sites.

xcoordcol

is the name of the column in the data frame with x coordinates or longitudinal coordinates

ycoordcol

is the name of the column in the data frame with y coordinates or latitudinal coordinates

CorModel

is the covariance structure. By default, CorModel is Exponential but other options include the Spherical and Gaussian.

coordtype

specifies whether spatial coordinates are in latitude, longitude (LatLon) form or UTM (UTM) form.

estmethod

is either the default "REML" for restricted maximum likelihood to estimate the covariance parameters and regression coefficients or "ML" to estimate the covariance parameters and regression coefficients.

covestimates

is an optional vector of covariance parameter estimates (nugget, partial sill, range). If these are given and estmethod = "None", the the provided vector are treated as the estimators to create the covariance structure.

detectionobj

is a fitted model obj from get_detection. The default is for this object to be NULL, resulting in spatial prediction that assumes perfect detection.

detinfo

is a vector consisting of the mean detection probability and its standard error. By default, it is set to c(1, 0), indicating perfect detection (1) with no variance (0). Using the default assumes perfect detection.

areacol

is the name of the column with the areas of the sites. By default, we assume that all sites have equal area, in which case a vector of 1's is used as the areas.

FPBKcol

is the name of the column with the prediction weights if the analyst would like to predict something other than the population total, like the total for a subset of the entire region of interest.

stratcol

is the column in the data set that contains the stratification variable.

Value

Information about the predicted total across all sites as well as variogram information for each stratum in the column stratcol. Output is in similar structure to FPBKoutput but with multiple strata.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
multistrat(formula = Moose ~ CountPred, data = vignettecount,
xcoordcol = "Xcoords", ycoordcol = "Ycoords",
areacol = "Area", stratcol = "Stratum")

## Note how the column names for coordinates, area, and stratum
## must be in quotes:

## Not run: 
multistrat(formula = Moose ~ CountPred, data = vignettecount,
xcoordcol = Xcoords, ycoordcol = Ycoords,
areacol = Area, stratcol = Stratum)
#' 
## End(Not run)

highamm/FPBK-with-Detection documentation built on Jan. 2, 2022, 6:35 a.m.