grasp {grasp} | R Documentation |
GRASP is a general method for making spatial predictions of response variables (RV) using point surveys of the RV and spatial coverages of Predictor variables (PV). GRASP uses Trevor Hastie's gam library.
grasp(selected.responses, selected.predictors, title = "GRASP: ", path = "", save.outputs = FALSE, save.PNG = FALSE, gr.fam = "binomial", weights = FALSE, set.limits = FALSE, use.limits = FALSE, reset.lim = TRUE, selxlim = gr.selX, npast = 10, make.summary = FALSE, plot.maps = FALSE, plot.distry = FALSE, plot.histograms = FALSE, plot.respvspred = FALSE, plot.xpred = FALSE, plot.correlation = FALSE, corlim = 100, use.correlation = FALSE, reset.cor = TRUE, full.models = FALSE, stepwise.models = FALSE, test = "F", plimit = 0.05, direction = "both", df1 = 0, df2 = 4, startwith = gr.selX, resetstart = TRUE, contributions = FALSE, plot.contributions = FALSE, plot.models = FALSE, response.curves = FALSE, model.anova = FALSE, validate.models = FALSE, predictions = FALSE, export.predictions = FALSE, plot.predictions = FALSE, lookup.tables = FALSE, plotpar = c(3, 3), prescol= "black", abscol="grey", nbar = 10, show.details = FALSE, StdError = TRUE, cvgroups = 5, resolution = as.integer((max(XXXpred$CX) - min(XXXpred$CX)) / (length(unique(XXXpred$CX)) - 1)) )
selected.responses |
Vector of column numbers or column names of YYY table, which contains response variables |
selected.predictors |
Vector of column numbers or column names of XXX table, which contains predictor variables |
title |
Title used in GRASP outputs |
path |
Working directory path |
save.outputs |
Send outputs for each response to a specific log file in your working directory |
save.PNG |
Save graphs as PNG files in your working directory |
gr.fam |
Choice of statistical distribution for Ys: "binomial", "poisson", "quasibinomial", "quasipoisson", "gaussian" |
weights |
Recalculate weights of 0s so that their sum is equal to sum of 1s |
set.limits |
Calculate and save limits of the environmental envelop of each responses (Ys) |
use.limits |
Use the saved limits in anylyses |
reset.lim |
Reset saved limits |
selxlim |
Vector of column numbers or column names of XXX table used to define limits |
npast |
Number of absences (0s) kept after the last presence (1) along each selected predictors used for calculating limits |
make.summary |
Calculate the data summary of selected Ys and Xs |
plot.maps |
Plot the spatial distribution of Ys |
plot.distry |
Histograms of the distribution of Ys |
plot.histograms |
Plot the distribution of Ys on histograms of Xs |
plot.respvspred |
Plot the relationship between Ys and Xs |
plot.xpred |
maps the predictors contained in XXXpred |
plot.correlation |
Calculate the correlations between Xs and eliminate Xs from candidate predictors if maximum correlation has been set with corlim |
corlim |
Maximum correlation allowed between predictors, if higher correlation found predictors are withdrawn from Xs candidate list. If correlated, the last selected Xs is removed |
use.correlation |
Select a model using only the uncorrelated predictors selected earlier |
reset.cor |
resetting candidate predictors (Xs) to all selected Xs |
full.models |
Select a model for each Ys forcing all candidate Xs in the models |
stepwise.models |
Select a model for each Ys from candidate Xs using the different possible options below |
test |
Choice of criterias (AIC, BIC) or tests (CHI and F (for quasi models)) |
plimit |
Probability limits for CHI and F tests |
direction |
Set the direction of selection, default is both |
df1 |
Optional smoother degree of freedom to be tested in variable selection |
df2 |
First smoother degree of freedom to be tested in variable selection |
startwith |
Vector of column numbers of predictors used to start stepwise procedure |
resetstart |
Resetting starting predictors (Xs) to all selected Xs |
contributions |
Calculate contributions of univariate models (alone), when dropping each predictor from the selected model (drop) and within the model (model) |
plot.contributions |
Plot the calculated contributions as bars |
plot.models |
Plot response curves of the selected models (using linear predictor scale before transformation into the response scale) |
response.curves |
Plot combined response curves of the selected models (using response scale after transformation by the inverse link function) |
model.anova |
Calculate an ANOVA table by removing each term from the full model |
validate.models |
Validate the selected models for each Ys using both simple validation and cross-validation |
predictions |
Calculate predictions for each Ys using selected model and new data (XXXpred) and save them in gr.predmat |
export.predictions |
Export saved predictions from gr.predmat to a text file that can be directly imported in Arcview as an ASCII GRID |
plot.predictions |
Plot saved predictions from gr.predmat |
lookup.tables |
Calculate lookup tables describing partial responses curves at the linear predictor scale for each Ys using minimum and maximum values for each Xs contained in XXXpred. These values are derived from min and max values of the GRIDs that are used to build spatial predictions in Arcview. |
plotpar |
number of rows and columns for multiple graphical outputs |
prescol |
Color for presences in graph outputs |
abscol |
Color for absences in graph outputs |
nbar |
Number of bars in histograms |
show.details |
Verbose output of stepwise selection |
StdError |
Show pointwise error around partial plot |
cvgroups |
Number of groups for cross validation |
resolution |
Resolution for gids maps |
MODELCALLS |
Calls of selected models |
VALIDATION |
Validation statistics for selected models |
ALONE.CONTRIB |
Predictor alone contributions for selected models |
DROP.CONTRIB |
Predictor drop contributions for selected models |
MODEL.CONTRIB |
Predictor model contributions for selected models |
Anthony.Lehmann@unige.ch
grasp.in
data(YYY) # reads in YYY,XXX and XXXpred demo dataset data(XXX) data(XXXpred) grasp.in(YYY,XXX,XXXpred) # initialize a new grasp session grasp(2:3,c(4:6,8:9), title = "GRASP: ", path = "", gr.fam = "binomial", weights = TRUE, make.summary = TRUE, plot.maps = TRUE, plot.distry = TRUE, plot.histograms = TRUE, plot.respvspred = TRUE, plot.xpred = TRUE,plot.correlation = TRUE, stepwise.models = TRUE, test = "AIC", contributions = TRUE, plot.contributions = TRUE, plot.models = TRUE, model.anova = TRUE, validate.models = TRUE, predictions = TRUE, plot.predictions = TRUE) # run a full grasp analysis on 2 responses with 5 predictors