msm.predict | R Documentation |
this is an internal function called by
qgcomp.glm.boot
,
but is documented here for clarity. Generally, users will not need to call
this function directly.
Get predicted values from a qgcompfit object from
qgcomp.glm.boot
.
msm.predict(object, newdata = NULL)
object |
"qgcompfit" object from |
newdata |
(optional) new set of data (data frame) with a variable
called |
(Not usually called by user) Makes predictions from the MSM
(rather than the conditional g-computation
fit) from a "qgcompfit" object. Generally, this should not be used in
favor of the default predict.qgcompfit
function. This
function can only be used following the qgcomp.glm.boot
function. For the
qgcomp.glm.noboot
function, predict.qgcompfit
gives
identical inference to predicting from an MSM.
set.seed(50)
dat <- data.frame(y=runif(50), x1=runif(50), x2=runif(50), z=runif(50))
obj <- qgcomp.glm.boot(y ~ z + x1 + x2 + I(z*x1), expnms = c('x1', 'x2'),
data=dat, q=4, B=10, seed=125)
dat2 <- data.frame(psi=seq(1,4, by=0.1))
summary(msm.predict(obj))
summary(msm.predict(obj, newdata=dat2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.