
Last chance! 50% off unlimited learning
Sale ends in
Plots nonparametric function estimates obtained from BayesX
plotnonp(data, x = 2, y = c(3, 4, 5, 7, 8), ylim = NULL,
lty = c(1, 2, 3, 2, 3), cols = rep(1, length(y)), month, year, step=12,
xlab, ylab, ...)
Either the name of a file or a data frame containing the estimation results.
Defines the x-axis in the plot. Either the name of a variable in data
or the index of the corresponding column.
Defines the variables to be plotted against x
. May be either a vector of names of variables
in data
or the corresponding indices. The default choice corresponds to the point estimate plus two
confidence bands.
Since plotnonp
plots multiple y-variables, it automatically determines the appropriate
ylim
to make all curves visible. Argument ylim
allows to override this default behaviour with fixed values.
Vector of line types used for plotting (must have the same length as y
). The default corresponds
to solid lines for the point estimate and dashed and dotted lines for the confidence bands.
Vector of colors used for plotting (must have the same length as y
). Default are black lines.
Provide specific annotation for plotting estimation results for temporal variables. month
and year
define the minimum time point whereas step specifies the type of temporal data with
step=4
, step=2
and step=1
corresponding to quartely, half yearly and yearly data.
plotnonp
constructs default labels that can be overwritten by these arguments
Further arguments to be passed to the interval call of plot
such as type
, etc.
Felix Heinzl, Andreas Brezger and Thomas Kneib
drawmap
,plotautocor
,plotsample
,plotsurf
res <- read.table(system.file("examples/nonparametric_f_x_pspline.res",
package="BayesX"), header=TRUE)
plotnonp(res)
plotnonp(res, x="x")
plotnonp(res, x="x", y="pmean")
plotnonp(res, x="x", y="pmed")
plotnonp(res, x="x", y="pmed", ylim=c(-2,2))
plotnonp(res, x="x", y=c("pmean", "pqu10", "pqu90"), lty=c(1,1,1),
col=c("red","blue","blue"))
plotnonp(res, xlab="some variable", ylab="f(some variable)",
main="Nonlinear effect of some variable", sub="penalised spline")
res <- read.table(system.file("examples/nonparametric2_f_time_pspline.res",
package="BayesX"), header=TRUE)
plotnonp(res)
plotnonp(res, month=1, year=1980, step=12)
res <- res[1:18,]
plotnonp(res, month=1, year=1980, step=12)
Run the code above in your browser using DataLab