| addapply | R Documentation |
Given a fitted point process model, consider adding new explanatory variables, and apply a significance test (or effect size calculation) for the effect of each new variable.
addapply(object,
action = c("berman.test", "cdf.test", "rhohat", "roc"),
scope,
..., high = TRUE)
object |
A fitted point process model (object of class |
action |
Character string (partially matched) specifying the hypothesis test to be performed, or other calculation. |
scope |
A formula or a character vector specifying the variable or variables that are to be considered for addition, or a fitted point process model containing all these variables. |
high |
Argument passed to |
... |
Other arguments passed to the relevant function
|
This function is like add1
in that it considers adding new terms to the model object
and measures the change in the model.
In this case the change is measured by performing the action.
Options are:
action="roc":the ROC curve for the added covariate
is computed using the original model object as a baseline.
action="berman.test":One of Berman's tests is applied
(see berman.test), using the
original model object
as the null hypothesis, and the extended model
as the alternative.
action="cdf.test":One of the CDF tests is applied
(see cdf.test), using the original
model object as the null hypothesis, and the extended model
as the alternative.
action="rhohat":taking the original model object as a baseline, the true intensity
(ratio of true intensity to baseline intensity)
is estimated as a function of the added explanatory variable,
using the function rhohat.
Note that addapply(object, "roc", scope)
is equivalent to addROC(object, scope).
Either object or scope should be a fitted point process
model, and the other argument may be a fitted point process model or a
formula. If object is a fitted model then scope may be a
character vector of the names of variables to be added.
A named list containing the results for each added variable.
The list belongs to the class "anylist"
so it can be printed and plotted in its entirety.
If action="roc" the individual entries are
ROC curves belonging to class "fv".
If action="rhohat" the individual entries are
curves belonging to class "fv" and class "rhohat".
If action="berman.test" the individual entries
are hypothesis tests of class "htest" and "bermantest".
If action="cdf.test" the individual entries
are hypothesis tests of class "htest" and "cdftest".
.
addROC,
dropROC,
roc.ppm,
rhohat,
berman.test,
cdf.test
dimyx <- if(interactive()) NULL else 32
fit0 <- ppm(bei ~ 1, data=bei.extra)
z <- addapply(fit0, "ber", . ~ grad+elev, dimyx=dimyx)
z
plot(z, mar.panel=5)
## how to extract p-values from each test
sapply(z, getElement, name="p.value")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.