diagnostics: diagnostics objects

Description Usage Arguments Examples

Description

extracts diagnostics from bbgdm object, like random quantile residuals and plots them. diagnostics can also call the 'Wald-like' test on a bbgdm object and returns a table of values.

Usage

1
2
3
4
5
6
7
8
diagnostics(object)

## S3 method for class 'diagnostics'
plot(x, ...)

bbgdm.wald.test(object, H0 = 0, gdm = FALSE)

is.diagnostics(x)

Arguments

object

bbgdm model output

x

diagnostic object

...

other plot arguments.

H0

A numeric value giving the null hypothesis for the test. Generally zero.

gdm

Logic if true calculates the Wald-test using variance-covariance matrix derived from the hessian matrix. Note: These estimates are probably wrong due to hessian matrix being calulated with respect to the likelihoods.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# fit bbgdm and extract residuals.
x <- matrix(rbinom(20*10,1,.6),20,10)# presence absence matrix
y <- simulate_covariates(x,2)
form <- ~ 1 + covar_1 + covar_2
test.bbgdm <- bbgdm(form,sp.dat=x, env.dat=y,family="binomial",
                    dism_metric="number_non_shared",nboot=10,geo=FALSE)
resids <- diagnostics(test.bbgdm)

# plot residuals
par(mfrow=c(2,2))
plot(resids)

# Undertake a wald test on bbdgm object
bbgdm.wald.test(test.bbgdm)

skiptoniam/bbgdm documentation built on May 30, 2019, 1:05 a.m.