Description Usage Arguments Details Author(s) Examples
2D plots of predicted values with interval estimates based on a bcgam
object and one non-parametrically
modelled predictor.
1 2 3 4 |
x |
Object of class inheriting from "bcgam". |
x1 |
A non-parametrically modelled predictor in a bcgam fit. There is no default variable. |
interval |
Type of interval to plot. It can be either |
parameter |
The type of parameter to be plotted. If parameter= |
x1.grid |
A positive integer that specifies how dense the x grid will be. The default is |
level |
Tolerance/credible level. The default is |
type |
What type of plot should be drawn. The default is for lines ( |
col |
Color of fitted values. The default is black ( |
col.inter |
Color of interval estimates. If not specified, it takes the
same value as |
lty |
What type of line should be drawn for fitted values. Ignored when a line is not being drawn.
The default is a solid line ( |
lty.inter |
What type of line should be drawn for interval estimates. The default is a dotted line ( |
lwd |
The line width of fitted values, a positive number, defaulting to |
lwd.inter |
The line width of interval estimates, a positive number, defaulting to |
ylim |
The |
... |
other parameters to be passed through to plotting functions. |
plot.bcgam
produces 2D plots based on the bcgam
object. Interval
estimates are based on the specified level
.
If there are more than one 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 2D 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 14 | ## 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")
plot(bcgam.fit, x1, parameter="mu", col=4, level=0.90)
plot(bcgam.fit, x2, parameter="eta", col=3, col.inter=2)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.