Documentation
Steps on how to use the LiMMCov app
Step 1: Load data
Begin by selecting an example dataset or uploading your data file. You can do this in the
Data Input
sidebar tab. Make sure to choose the correct file extension to ensure proper data loading. Make sure your dataset is in long format (i.e., one row per subject per time point). Wide-format data must be reshaped prior to use.
If you need to change the data type of a variable, select the variable in question and then choose the
New data type.
Apply changes by clicking the
Change data type
button.
To verify that the data has been loaded correctly, check the
View Data
tab, which displays a preview (10 rows by default). You can adjust this setting through the
Show entries
dropdown. A summary of your dataset, including descriptive statistics and variable distributions, can be found in the
Data Summary
tab.
Note on Missing Data:
LiMMCov requires complete datasets, so we recommend handling missing values before uploading. While multiple imputation is one possible strategy, other approaches (e.g., full information maximum likelihood, inverse probability weighting) may be more appropriate depending on factors like sample size or missing not at random (MNAR) data. Because LiMMCov focuses on choosing the covariance structure, data preprocessing and imputation lie outside the app’s scope. We encourage users to consult the references below for best practices in addressing missingness, ensuring the validity of subsequent analyses:
- Molenberghs G, Fitzmaurice G, Kenward MG, Tsiatis A, Verbeke G. Handbook of missing data methodology. CRC Press; 2014.
- Nooraee N, Molenberghs G, Ormel J, Van den Heuvel ER. Strategies for handling missing data in longitudinal studies with questionnaires. J Stat Comput Simul. 2018;88(17):3415–36. https://doi.org/10.1080/00949655.2018.1520854
- Ji L, Chow SM, Schermerhorn AC, Jacobson NC, Cummings EM. Handling Missing Data in the Modeling of Intensive Longitudinal Data. Struct Equ Model. 2018;25(5):715–36. https://doi.org/10.1080/10705511.2017.1417046
- Heymans MW, Twisk JWR. Handling missing data in clinical research. J Clin Epidemiol. 2022;151:185–8. https://doi.org/10.1016/j.jclinepi.2022.08.01
Step 2: Fit linear model (GLM)
Next, specify the variables for the model. Start by selecting the subject/id, outcome variable, and the desired mean structure in the
General Linear Model (GLM)
tab.
After specifying the model, click the
Run GLM
button to fit the model. You can view the model results under the
Model Summary
section.
Step 3: Analyse the covariance
Use the
Covariance Analysis
tab to explore the underlying covariance structure of the residuals. It provides insights into the correlation structure of residuals from the GLM. Residual plots help identify specific patterns related to different correlation structures, while PACF plots provide further insight.
Interpreting Residual Plots and PACF:
Use this quick reference guide to determine the appropriate covariance structure based on your residual plots and PACF patterns:
-
Step 1:
Examine the residual plot. If there is no correlation (flat line across all lags), use Compound Symmetry (CS).
-
Step 2:
If residuals oscillate, use AR(2).
-
Step 3:
If there is a gradual decay in correlation, check the PACF.
-
PACF: Single spike at lag 1 →
Use AR(1).
-
PACF: Spikes at lags 1 and 2 →
Use AR(2).
-
PACF: Multiple spikes up to lag p →
Use AR(p).
The following covariance structures are available in the nlme package, each with different applications:
-
corAR1 (Autoregressive order 1):
- Models a correlation where observations closer in time/space are more correlated.
- The correlation decays exponentially as time/distance increases.
- In residual plots, covariances decay linearly with increasing lags.
- Use for equally spaced measurements.
-
corAR(p) - Autoregressive order p:
- Allows for complex autoregressive patterns beyond AR1.
- Graphical patterns depend on specific AR orders.
- Suitable for equally spaced time points.
-
corCAR1 (Continuous AR1):
- Similar to AR1, but for continuous-time covariates.
- Correlation decays exponentially with increasing time/distance.
- Useful for unequally spaced time points.
- Ideal for continuous-time and unbalanced data.
-
corCompSymm (Compound Symmetry):
- Assumes constant correlation across all observation pairs.
- Equal variance parameters (homogeneous).
- Covariances at all lags in residual plots will be similar.
- For equally spaced time points and exchangeable structures.
-
Spatial Correlation (corExp, corGaus, etc.):
- Models spatial correlation based on distance between observations.
- Useful for irregularly spaced observations in 2D/3D space.
- Non-linear covariance patterns based on spatial locations.
- Ideal for continuous-time and unbalanced data.
-
corSymm (General Correlation):
- Unstructured correlation matrix.
- No pattern assumptions.
- No specific graphical pattern.
- Useful for complex, irregular correlation structures but requires more parameters.
Step 4: Fit linear mixed model (LMM)
To fit a linear mixed model, select the subject/id, outcome, time variables, and fixed effects. If your model includes interaction terms, define them using the
Select interaction term(s)
field.
You can select the observed covariance structure from the dropdown. For higher AR terms, use the AR(p) option and specify the appropriate order.
Fit the model by clicking the
Run LMM
button. The results will appear under the
Model Summary
section.
To compare different models, refer to the AIC table. The model with the lowest AIC is generally considered the best-fitting model. If convergence issues occur, they will be flagged in the AIC column.
Step 5: Generate a report
After your analysis, you can generate a report by selecting the desired format (HTML, PDF, or Word). This report includes a summary of the linear model, covariance analysis, and the best-fitting linear mixed model, along with plots.
Note
At any time, you can refresh the session and start over by clicking the
Power
button.