View source: R/compute_correlations.R
compute_correlations | R Documentation |
time_model()
.Based on computed area under the curves (i.e., compute_aucs()
)
and slopes (i.e., compute_slopes()
) for several intervals using
a model fitted by time_model()
, compute the correlations between
each intervals derived parameters.
compute_correlations(
fit,
method,
period = c(0, 0.5, 1.5, 3.5, 6.5, 10, 12, 17),
knots = list(cubic_slope = NULL, linear_splines = c(0.75, 5.5, 11), cubic_splines =
c(1, 8, 12))[[method]]
)
fit |
A model object from a statistical model such as
from a call to |
method |
The type of model provided in |
period |
The intervals knots on which AUCs are to be computed. |
knots |
The knots as defined |
A list
object with correlations between each intervals derived parameters.
data("bmigrowth")
ls_mod <- time_model(
x = "age",
y = "log(bmi)",
cov = NULL,
data = bmigrowth[bmigrowth[["sex"]] == 0, ],
method = "linear_splines"
)
compute_correlations(
fit = ls_mod,
method = "linear_splines",
period = c(0, 0.5, 1.5, 3.5, 6.5, 10, 12, 17)#,
# knots = list(
# "cubic_slope" = NULL,
# "linear_splines" = c(0.75, 5.5, 11),
# "cubic_splines" = c(1, 8, 12)
# )[[method]]
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.