plot.pblm | R Documentation |
pblm
object
Plotting fixed or smooth terms for a pblm
object
## S3 method for class 'pblm'
plot(x, which.eq=1:3, which.var=1:x$maxNpred, add.bands=TRUE,
type="l",col.line=list("blue"), col.bands=NULL,
dashed.bands=FALSE, pause = FALSE, ylim, xlim, ylab, xlab,
main, overlaid_pvc=TRUE,...)
x |
An object of class |
which.var |
Index of the smoother term, indicating its position in the model formula. |
which.eq |
Equation index identifying the component (marginal or association) where the smoother is applied. |
add.bands |
Logical. Should confidence bands for the smoother be added to the plot? |
col.bands |
Color to be used for the confidence bands. |
col.line |
Color to be used for the smoother line. Different colors are allowed when using |
type |
Graphical parameter specifying the plot type. |
dashed.bands |
Logical. If |
pause |
Logical. If |
ylim |
Graphical parameter defining the limits of the y-axis. |
xlim |
Graphical parameter defining the limits of the x-axis. |
ylab |
Graphical parameter specifying the label for the y-axis. |
xlab |
Graphical parameter specifying the label for the x-axis. |
main |
Graphical parameter specifying the main title of the plot. |
overlaid_pvc |
Logical. Under development, currently ignored. |
... |
Further graphical parameters to be passed to the plotting functions. |
This function works similarly to the termplot
function for many statistical models,
and is based on the predict
method. The argument overlaid_pvc
is currently ignored because, although implemented, the smoother function pvc()
for fitting
penalized varying coefficient models is still experimental and not included in this
version of the package.
Returns the plots of the partial effects for the terms specified in the model formula,
or for a specific term identified by which.equation
and which.term
.
In addition, a variable-length list is returned, containing one object for each term included
in the model formula or selected via which.equation
and which.term
.
Each object is named by concatenating the equation type and the term name, and consists of
a data frame with as many rows as the original dataset and four columns:
the x-axis values, the y-axis values, the 95% lower bounds, and the 95% upper bounds.
For example, consider a variable named v
included in the model for both marginals and the association.
The returned list would include:
mar1:v |
A data frame containing the plotting data for variable |
mar2:v |
A data frame containing the plotting data for variable |
ass12:v |
A data frame containing the plotting data for variable |
... |
Additional data frames, depending on the number of terms involved. |
Marco Enea
pb
, pbs
#NOT RUN
# an artificial data set:
set.seed(123)
da <- expand.grid("Y1"=1:3,"Y2"=1:3,"v1"=0:4,"fat2"=0:1)
da$Freq <- sample(0:20,3*3*5*2,replace=TRUE)
da$x1 <- rnorm(90)
#the bivariate additive proportional-odds model
m7 <- pblm(fo1=cbind(Y1,Y2) ~ v1 + fat2 + pb(x1), data=da, weights=Freq)
plot(m7)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.