plotVarReg | R Documentation |
plotVarReg
to produce graphics for models fit in this package.
plotVarReg(
x,
knot.lines = FALSE,
ci = FALSE,
ci.type = c("im", "boot"),
bootreps = 1000,
xlab = "x",
ylab = "y",
control = list(...),
...
)
x |
Object of class |
knot.lines |
Logical to indicate if knot lines should be shown on graphics
(if model is type "semi"). Default is |
ci |
Logical indicate if 95% CI should be shown on the plots. Default is |
ci.type |
Text to indicate the type of CI to plot. Either |
bootreps |
Integer to indicate the number of bootstrap replications to be performed if |
xlab |
Text for the label to be placed on the |
ylab |
Text for the label to be placed on the |
control |
list of control parameters to be used in bootstrapping.
See |
... |
arguments to be used to form the default control argument if it is not supplied directly |
This function returns a 2x2 plot, with slightly different plots given, depending on the outcome data. For uncensored data, the plots are:
the mean function over the x
-variable, with or without 95% CI, and with or
without the knot lines indicated
the variance function over the x
-variable, with or without 95% CI and with or
without the knot lines indicated
a Q-Q plot of the residuals from the model
a histogram of the residuals from the model
If the outcome data is censored, the last two plots are no longer appropriate. Given the censored residuals from the model, we can compare the squared standardised residuals (given in black) with their censoring indicator to the chi-squared distribution with one degree of freedom (given in red). This is one of the plots given for censored data, and the other is a plot of the data, coloured by the censoring status. The triangles with the point at the top are bottom censored and the triangles with the point at the bottom are top censored.
semiVarReg
, VarReg.control
data(mcycle)
linmodel<-semiVarReg(mcycle$accel, mcycle$times, meanmodel="linear", varmodel="linear",
maxit=10000)
plotVarReg(linmodel)
plotVarReg(linmodel, ci=TRUE, ci.type="im", ylab="Range", xlab="Time in seconds")
##not run
##plotVarReg(linmodel, ci=TRUE, ci.type="boot", bootreps=10,ylab="Acceleration",
##xlab="Time in seconds")
##not run
##semimodel<-semiVarReg(mcycle$accel, mcycle$times, meanmodel="semi", varmodel="semi",
##knots.m=4, knots.v=2, maxit=10000)
##plotVarReg(semimodel, ci=TRUE, ci.type="boot",bootreps=10,ylab="Acceleration",
##xlab="Time in seconds", maxit=10000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.