persp.bcgam: 3D plots for 'bcgam' fits

Description Usage Arguments Details Author(s) Examples

View source: R/persp_bcgam.R

Description

3D plots of fitted surface with credible interval estimates based on a bcgam object and two non-parametrically modelled predictors.

Usage

1
2
3
4
5
## S3 method for class 'bcgam'
persp(x, x1, x2, parameter = "mu", level = 0.95,
  x1.grid = 10, x2.grid = 10, lty = 1, lty.inter = 1,
  ticktype = "detailed", col = 4, col.inter = col, surf.inter = TRUE,
  zlim = NULL, ...)

Arguments

x

Object of class inheriting from "bcgam".

x1

A non-parametrically modelled predictor in a bcgam fit. The predictor in the x axis. There is no default variable.

x2

A non-parametrically modelled predictor in a bcgam fit. The predictor in the y axis. There is no default variable.

parameter

The type of parameter to be plotted. If parameter="eta", then the systematic component η is plotted. If parameter="mu", then the mean value μ obtained by transforming η using the inverse of the link function is plotted. The default is "mu".

level

Tolerance/credible level. The default is 0.95.

x1.grid

A positive integer that specifies how dense the x grid will be. The default is 10.

x2.grid

A positive integer that specifies how dense the y grid will be. The default is 10.

lty

What type of surface edges should be drawn for fitted values. The default is a solid line (1).

lty.inter

What type of surface edges should be drawn for interval estimates. The default is a solid line (1).

ticktype

character: "detailed" draws normal ticks; "simple" draws just an arrow parallel to the axis to indicate direction of increase. The default is "detailed".

col

Color of fitted surface. The default is blue (4).

col.inter

Color of interval estimates. If not specified, it takes the same value as col.

surf.inter

Indicator to draw interval estimates ("TRUE") or not ("FALSE"). The default is "TRUE".

zlim

The z limits of the plot. If zlim=NULL and surf.inter="TRUE", then the minimum value of the lower bound estimates and the maximum value of the upper bound estimates are used. If zlim=NULL and surf.inter="FALSE", then the minimum and maximum values of the fitted surface are used. The default is NULL.

...

additional graphical parameters.

Details

persp.bcgam produces 3D plots based on the bcgam object. Interval estimates are based on the specified level.

If there are more than two non-parametrically modelled predictors, then these will be evaluated at the largest values that are smaller than or equal to their median values. Categorical covariates will be evaluated at their mode. Also, continuous covariates will be evaluated at the largest values that are smaller than or equal to their median values.

This routine creates 3D plots based on the posterior distribution in the bcgam object.

Author(s)

Cristian Oliva-Aviles and Mary C. Meyer

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
n<-50
x1<-(1:n/n)^{1/3}
x2<-log(1:n/n)
z<-as.factor(rbinom(n, 1, 0.6))
eta<-x1+x2+0.2*as.numeric(z)+rnorm(n, sd=0.2)
mu<-exp(eta)/(1+exp(eta))
y<-(mu<0.6)

bcgam.fit <- bcgam(y~sm.incr(x1)+sm.conc(x2, numknots=8)+z, nloop=10000, family="binomial")
persp(bcgam.fit, x1, x2, parameter="eta", col.inter=2, level=0.90, theta=-55)

## End(Not run)

bcgam documentation built on May 2, 2019, 8:42 a.m.

Related to persp.bcgam in bcgam...