Title: | Build Network Based on Linear Mixed Models from EHRs |
---|---|
Description: | Analyzing longitudinal clinical data from Electronic Health Records (EHRs) using linear mixed models (LMM) and visualizing the results as networks. It includes functions for fitting LMM, normalizing adjacency matrices, and comparing networks. The package is designed for researchers in clinical and biomedical fields who need to model longitudinal data and explore relationships between variables For more details see Bates et al. (2015) <doi:10.18637/jss.v067.i01>. |
Authors: | Vargas-Fernández Marina [aut, cre], Martorell-Marugán Jordi [aut], Carmona-Sáez Pedro [aut] |
Maintainer: | Vargas-Fernández Marina <marina.vargas@genyo.es> |
License: | GPL-3 |
Version: | 1.0.0 |
Built: | 2025-03-21 17:19:08 UTC |
Source: | CRAN |
This function returns difference matrix between two networks. It is useful for comparing two networks represented by adjacency matrices.
differentiation(matrix1, matrix2)
differentiation(matrix1, matrix2)
matrix1 |
The first adjacency matrix. |
matrix2 |
The second adjacency matrix. |
a normalized matrix containing values between 0 and 1.
This dataset contains self-reported psychological and behavioral responses from individuals.
example_data
example_data
A data frame with multiple rows and 17 variables:
Unique participant identifier (integer).
Self-reported relaxation level (integer scale).
Self-reported irritability level (integer scale).
Level of worry experienced (integer scale).
Self-reported nervousness (integer scale).
Concerns about the future (integer scale).
Self-reported lack of enjoyment (integer scale).
Level of tiredness (integer scale).
Self-reported hunger level (integer scale).
Feeling of loneliness (integer scale).
Level of anger experienced (integer scale).
Offline social interactions (integer scale).
Online social interactions (integer scale).
Time spent listening to music (integer scale).
Self-reported procrastination (integer scale).
Time spent outdoors (integer scale).
Engagement in activities during COVID-19 (integer scale).
Level of worry related to COVID-19 (integer scale).
Time spent at home (integer scale).
Day number of the study (integer).
Moment within the day when data was collected (integer).
Self-reported concentration level (integer scale).
This dataset was collected from a study examining psychological and behavioral responses to various daily experiences. Each row represents a unique moment of self-reporting.
Reproducible figure for Nature Methods primer paper, Borsboom et al. 2021. This examples contains a subset of variables collected and modeled in our covid19 paper. This paper, with full data is available on https://journals.sagepub.com/doi/10.1177/21677026211017839. Eiko Fried, March 14 2021
data(example_data) head(example_data)
data(example_data) head(example_data)
This function automates the analysis of longitudinal clinical data using linear mixed models. It models clinical variables and returns a weighted matrix of model coefficient scores.
lmm_analysis( clinical_data, variables_to_scale, random_effects = "(1 | participant_id)" )
lmm_analysis( clinical_data, variables_to_scale, random_effects = "(1 | participant_id)" )
clinical_data |
Dataframe containing clinical and metadata for participants, including identifier as |
variables_to_scale |
Character vector of variable names to be analyzed. |
random_effects |
A character string specifying the random effects formula (default: "(1 | participant_id)"). |
A matrix of model coefficient scores, where rows represent dependent variables and columns represent independent variables.
This function normalizes weighted adjacency matrix derived from lmm.
normalization(matrix)
normalization(matrix)
matrix |
The adjacency matrix (to be normalized). |
a normalized matrix containing values between 0 and 1.
This function adjusts an original matrix by copying the lower triangular part from a shifted matrix.
score_matrix(original_matrix, shifted_matrix)
score_matrix(original_matrix, shifted_matrix)
original_matrix |
A numeric matrix representing the original data. |
shifted_matrix |
A numeric matrix that has been transformed using |
A new matrix with adjusted values in the lower triangular part.
This function modifies the shape of a model weights matrix by shifting its elements.
shift_matrix(mat)
shift_matrix(mat)
mat |
A numeric matrix to be transformed. |
A shifted version of the input matrix.