lme_model | R Documentation |
Fits a Linear Mixed Effects Model
lme_model(
dataset,
ry,
rind,
rtime = NULL,
rmet = NULL,
vecD = NULL,
covar = NULL,
rho = 0,
int = FALSE,
cl = 0.95,
control.lme = list(),
apVar = TRUE,
...
)
dataset |
an object of class |
ry |
Character string. Name of the outcome in the data set. |
rind |
Character string. Name of the subject variable in the data set. |
rtime |
Character string. Name of the time variable in the data set. |
rmet |
Character string. Name of the method variable in the data set. |
vecD |
Vector of weights. The length of the vector must be the same as the number of repeated measures. |
covar |
Character vector. Name of covariates to include in the linear mixed model as fixed effects. |
rho |
Within subject correlation structure. A value of 0 (default option) stands for compound symmetry and 1 is used for autoregressive of order 1 structure. |
int |
Boolean indicating if the subject-method interaction has to be included in the model. |
cl |
Confidence level. |
control.lme |
A list of control values for the estimation algorithm used in |
apVar |
Logical. Should the asymptotic variance-covariance matrix of the variance components be estimated in the linear mixed model? (Defaults to TRUE). |
... |
To pass further arguments. |
an object of class lme
.
# Reliability ICC
set.seed(2024)
df <- ccc_sim_data(b = NULL, g = NULL, mu = -0.25, sa = 1.5, se = 1)
mod1 <- lme_model(df,"y","id")
mod1
#Non-longitudinal Methods comparison data
set.seed(2024)
df2 <- ccc_sim_data(n=50,b = c(0,1), mu = -0.25, sa = 1.5, se = 1, nrep=2)
mod2 <- lme_model(df2,"y","id",rmet="met")
mod2
# Longitudinal Methods comparison data
set.seed(2024)
df3 <- ccc_sim_data(n=50, b = c(0,1), g=c(0,0.25,0.5), mu = -0.25, sa = 1.5,
sab=0.25,sag=0.5,bg=c(0,0.5,0.75,0,1,1),se = 1, nrep=2)
mod3 <- lme_model(df3,"y","id","times","met",control.lme=nlme::lmeControl(opt = 'optim'))
mod3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.