make_newdata {survHE} | R Documentation |
Creates a 'newdata' list to modify the plots for specific individual profiles (with respect to the covariates)
Description
Creates a 'newdata' list to modify the plots for specific individual profiles (with respect to the covariates)
Usage
make_newdata(data, vars, conts = NULL)
Arguments
data |
The original dataset that has been used as input to the call to 'fit.models' |
vars |
A vector of strings, including the names of the variables that are to be used to construct specific profiles of individual covariates |
conts |
A subset of 'vars', which include the named covariates that are continuous. These will be averaged over, while for the remaining covariates (assumed to be factors), the specific profiles will be listed. Defaults to NULL |
Value
newdata |
The list 'newdata' to be passed as optional argument to a call to the 'plot' method |
labs |
A vector of labels (say to use in the plot, for each profile) |
Note
Something will go here
Author(s)
Gianluca Baio
Examples
## Not run:
data(bc)
# Fits a model using the 'bc' data
mle = fit.models(formula=Surv(recyrs,censrec)~group,data=bc,
distr="exp",method="mle")
# Now makes the default plot
plot(mle)
# Now creates a 'newdata' list to modify the plot for selected profiles
newdata=make_newdata(data=bc,vars="group")
# And can plot, say, only two of the three treatment arms
plot(mle,newdata=newdata$newdata[c(1,3)],lab.profile=newdata$labs[c(1,3)])
## End(Not run)
[Package survHE version 2.0.5 Index]