Learn R Programming

McSpatial (version 2.0)

maketarget: Target Points for Nonparametric Models

Description

Identifies target points at which to evaluate nonparametric models with one or two explanatory variables.

Usage

maketarget(form,window=.25,bandwidth=0,kern="tcub",actualobs=FALSE,data=NULL)

Arguments

form
The model formula to be used to determine target points. The dependent variable is irrelevant, so form=y~x and form=~x are equivalent. No more than two explanatory variables should be listed.
window
The window size.
bandwidth
The bandwidth. The window option is ignored if bandwidth >0.
kern
The kernel weight function.
actualobs
If FALSE, the points identifed as targets are not constrained to be actual data points. Specifying actualobs = TRUE produces target points that are drawn from the original data matrix implied by form.
data
A data frame containing the data. Default: use data in the current working directory

Value

target
The set of target points.
obs
If actualobs = TRUE, obs is the list of observation numbers in the original data set from which the target points are drawn. obs = NULL if actualobs = FALSE.

Details

The maketarget function uses the locfit package's adaptive decision tree approach to identify target locations. If actualobs = TRUE, the output of maketarget is set of actual data points closest to these target locations, along with the convex hull identified by the chull command. The variable obs can be used to indicate the target observations for actualobs models. This actualobs = TRUE option is required by the following commands: lwr, lwrgrid, cparlwr, cparlwrgrid, and semip.

References

Loader, Clive. Local Regression and Likelihood. New York: Springer, 1999. Section 12.2.

See Also

cparlogit cparlwr cparlwrgrid cparmlogit cparprobit lwr lwrgrid qregcpar qreglwr semip

Examples

Run this code
data(cookdata)
target <- maketarget(~LONGITUDE+LATITUDE,window=.25,data=cookdata)$target

Run the code above in your browser using DataLab