pblm
objectPlotting fixed or smooth terms for a pblm
object
# S3 method for 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,...)
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:
A data frame containing the plotting data for variable v
in the first marginal.
A data frame containing the plotting data for variable v
in the second marginal.
A data frame containing the plotting data for variable v
in the association component.
Additional data frames, depending on the number of terms involved.
An object of class pblm
.
Index of the smoother term, indicating its position in the model formula.
Equation index identifying the component (marginal or association) where the smoother is applied.
Logical. Should confidence bands for the smoother be added to the plot?
Color to be used for the confidence bands.
Color to be used for the smoother line. Different colors are allowed when using pvc()
.
Graphical parameter specifying the plot type.
Logical. If TRUE
(and add.bands
is also TRUE
), dashed confidence bands will be drawn instead of filled color bands.
Logical. If TRUE
, the user will be prompted to press a key before each plot is displayed.
Graphical parameter defining the limits of the y-axis.
Graphical parameter defining the limits of the x-axis.
Graphical parameter specifying the label for the y-axis.
Graphical parameter specifying the label for the x-axis.
Graphical parameter specifying the main title of the plot.
Logical. Under development, currently ignored.
Further graphical parameters to be passed to the plotting functions.
Marco Enea
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.
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)
Run the code above in your browser using DataLab