Description Usage Arguments Details Author(s) Examples
3D plots of fitted surface with credible interval estimates based on a bcgam
object and two non-parametrically
modelled predictors.
1 2 3 4 5 |
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= |
level |
Tolerance/credible level. The default is |
x1.grid |
A positive integer that specifies how dense the x grid will be. The default is |
x2.grid |
A positive integer that specifies how dense the y grid will be. The default is |
lty |
What type of surface edges should be drawn for fitted values. The default is a solid line ( |
lty.inter |
What type of surface edges should be drawn for interval estimates. The default is a solid line ( |
ticktype |
character: "detailed" draws normal ticks; "simple" draws just an arrow parallel to the
axis to indicate direction of increase. The default is |
col |
Color of fitted surface. The default is blue ( |
col.inter |
Color of interval estimates. If not specified, it takes the
same value as |
surf.inter |
Indicator to draw interval estimates ( |
zlim |
The |
... |
additional graphical parameters. |
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.
Cristian Oliva-Aviles and Mary C. Meyer
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.