View source: R/run_eggla_lmm.R
run_eggla_lmm | R Documentation |
Perform Daymont's quality-control for BMI,
fit a cubic splines mixed model regression
with linear splines as random effect,
save model object, generates residuals figures fot model validity,
derived area under the curve and slopes for male and femal.
This function is a wrapper around egg_model()
, egg_slopes()
and egg_aucs()
.
run_eggla_lmm(
data,
id_variable,
age_days_variable,
age_years_variable,
weight_kilograms_variable,
height_centimetres_variable,
sex_variable,
covariates,
male_coded_zero = FALSE,
random_complexity = "auto",
use_car1 = FALSE,
knots = c(1, 8, 12),
period = c(0, 0.5, 1.5, 3.5, 6.5, 10, 12, 17),
start = 0.25,
end = 10,
step = 0.01,
filter = NULL,
outlier_method = "iqr",
outlier_threshold = list(iqr = 2),
outlier_exclude = TRUE,
parallel = FALSE,
parallel_n_chunks = 1,
working_directory = getwd(),
quiet = FALSE,
clean = TRUE
)
data |
Phenotypes data that inherits from |
id_variable |
Name of the column where sample/individual IDs are stored. |
age_days_variable |
Name of the column where age in days is stored.
|
age_years_variable |
Name of the column where age in years is stored.
|
weight_kilograms_variable |
Name of the column where weight in kilograms is stored. |
height_centimetres_variable |
Name of the column where height in centimetres is stored. |
sex_variable |
Name of the column where sex is stored. |
covariates |
A vector of columns' names to be used as covariates.
|
male_coded_zero |
Is male coded "0" (and female coded "1")? |
random_complexity |
A numeric (1-3) indicating the complexity of the random effect term.
Default, |
use_car1 |
A logical indicating whether to use continuous auto-correlation, i.e., CAR(1) as correlation structure. |
knots |
The knots defining the splines. |
period |
The intervals knots on which slopes are to be computed. |
start |
The start of the time window to compute AP and AR. |
end |
The end of the time window to compute AP and AR. |
step |
The step to increment the sequence. |
filter |
A string following |
outlier_method |
The outlier detection method(s). Default is |
outlier_threshold |
A list containing the threshold values for each method (e.g.,
|
outlier_exclude |
Whether or not the values/individuals flagged as being outliers should be excluded.
Default is |
parallel |
Determines if |
parallel_n_chunks |
Specify the number of batches (in |
working_directory |
Directory in which computation will occur and where output files will be saved. |
quiet |
A logical indicating whether to suppress the output. |
clean |
A logical indicating whether to clean |
Path to zip archives.
if (interactive()) {
data("bmigrowth")
fwrite(
x = bmigrowth,
file = file.path(tempdir(), "bmigrowth.csv")
)
res <- run_eggla_lmm(
data = fread(file.path(tempdir(), "bmigrowth.csv")),
id_variable = "ID",
age_days_variable = NULL,
age_years_variable = "age",
weight_kilograms_variable = "weight",
height_centimetres_variable = "height",
sex_variable = "sex",
covariates = NULL,
random_complexity = 1,
working_directory = tempdir()
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.