recycler: Calculate change in predicted probabilities

Description Usage Arguments Value See Also Examples

View source: R/prediction.R

Description

recycler wraps many of the functions in postMCMCglmm to calculate the change in predicted probabilities for a twiddle change in the predictor, or for discrete predictors, it can use values so it is the change from 0 to 1 (for example). The result is a MCMCglmmPredictedProbs (of course a difference but still) object, so it can be summarized using the MCMCglmmPredictedProbs summary method. This gives average marginal recycled predicted probabilities, as well as highest posterior density intervals.

Usage

1
  recycler(object, index = 2L, twiddle, values, ...)

Arguments

object

A MCMCglmm model object to use for recycled predictions.

index

An integer indicating the column of the fixed effects design matrix, X, to vary. Defaults to 2L.

twiddle

A twiddle value for continuous variables. Needs to be small enough for the scale of the predictor that a twiddle change is a reasonable approximation of taking the first derivative at a point. That is, a very small change. If missing, reverts to .01.

values

Specific values to use for the varying predictor. These are primarily meant for discrete predictors rather than continuous ones.

...

Passed on to predict2

Value

A list of class MCMCglmmPredictedProbs that are the differences in predicted probabilities for a one unit change (calculated from the twiddle value or between the discrete values supplied in values).

See Also

summary.MCMCglmmPredictedProbs, predict2.MCMCglmm

Examples

1
2
3
4
## Not run: 
  ## Make me!

## End(Not run)

JWiley/postMCMCglmm documentation built on May 7, 2019, 10:15 a.m.