Description Usage Arguments Details Value See Also Examples
Choosing the best distribution for parametric survivial models is not trivial.
One possibility is to select of all plausible distributions the one with which
the resulting models' AIC is minimal. Therefore, several models have to be
fitted and compared. compare_PSMdist
fits the models for all distributions
that come into consideration by calling survreg
. The
fitting of the models is parallelised via snowfall.
1 2 3  compare_PSMdist(Formula, Data, Distributions = c("weibull", "exponential",
"lognormal", "loglogistic"), parallel = TRUE, cpus = NULL,
type = "SOCK", level = 0.95, ...)

Formula 
A formula expression as for other regression models passed to

Data 
A data frame where the variables in formula are found. 
Distributions 
A character vector. The names of the distributions to be
used. See 
parallel 
Logical determinating parallel or sequential execution, passed
to 
cpus 
Passed to 
type 
Passed to 
level 
Passed to 
... 
Further arguments passed to 
If parallel = TRUE
(the default) and cpus
is not specified, on Unix systems all but one CPU will be used by
sfInit
. Other systems will use cpus = 2
.
A list consiting of:
Formula
The formula used for the fitting call.
Distribution
A character vector naming the distributions used for the models. It defines the order for the following list elements.
Fit
A logical vector: if FALSE
the corresponding model
could not be fitted without problems and a Message
is returned.
Message
A character vector: NA
if the corresponding model
was fitted without problems, otherwise the error message.
AIC
A numeric vector with the AIC
of the
models. NA
if the fitting of the corresponding model caused problems.
Effects
A numeric array: the levels of the model effects define
the rows, three columns (estimated coefficient, lower and upper confidence
limits at 95%level as default), and separate layers for each distribution.
NA
if the fitting of the corresponding model caused problems.
logScale
A numeric matrix with one row for each distribution,
and three columns (estimated coefficient, lower and upper confidence limits
at 95%level as default). NA
if the fitting of the corresponding
model caused problems.
FrailtyVar
A numeric vector with the estimated variance of the
frailty effect (if one is included.). NA
if the fitting of the
corresponding model caused problems.
show_comparison
produces a print and readable table of
the comparison.
1 2 3 4 5 6  intS2 < with(MIC, create_int2Surv(concentration, inhibition))
compare_PSMdist(as.formula("intS2 ~ region"), Data = cbind(intS2, MIC))
compare_PSMdist(as.formula("intS2 ~ region + frailty(herd, sparse = FALSE)"),
Data = cbind(intS2, MIC), cpus = 2, control = survreg.control(maxiter = 100))
compare_PSMdist(as.formula("intS2 ~ 1 + frailty(herd, sparse = FALSE)"),
Data = cbind(intS2, MIC), cpus = 2, control = survreg.control(maxiter = 100))

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.