Coder Social home page Coder Social logo

rifatzahan / ctsem_suicide Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.33 MB

Unraveling the Temporal Dynamics of Suicidality, Depression, Irritability, and Connectedness in Psychiatric Inpatients: A Continuous Time Dynamic Modelling Approach for Smartphone-Based Longitudinal Data

R 1.84% HTML 98.16%

ctsem_suicide's Introduction

Unraveling the Temporal Dynamics of Suicidality, Depression, Irritability, and Connectedness in Psychiatric Inpatients: A Continuous Time Dynamic Modelling Approach for Smartphone-Based Longitudinal Data

This repository contains the code for the study titled "Unraveling the Temporal Dynamics of Suicidality, Depression, Irritability, and Connectedness in Psychiatric Inpatients: A Continuous Time Dynamic Modelling Approach for Smartphone-Based Longitudinal Data". The study explores the interdependence of suicidality, depression, irritability, and connectedness among psychiatric inpatients over time using Hierarchical Bayesian Continuous Time Dynamic Models or Continuous Time Structural Equation Modeling (CTSEM) with Kalman filtering.

Overview

This project explores the potential of using CTSEM as a powerful tool to examine complex, time-varying mental health constructs, and their reciprocal relationships. Longitudinal data from 30 psychiatric inpatients collected using a smartphone-based app is analyzed, and the project includes an examination of within-person variability and heterogeneity, as well as the estimation of the auto-effect and cross-lagged effects between the mental health constructs.

Data

The dataset contains the following variables:

The dataset contains the following variables:

  • id: Participant ID
  • suicidality: Suicidality scores collected longitudinally
  • depression: Depression scores collected longitudinally
  • irritability: Irritability scores collected longitudinally
  • connectedness: Connectedness scores collected longitudinally
  • dayOfStudy: Number of days since the start of the study
  • startDate: Start date of the study for each participant
  • endDate: End date of the study for each participant
  • status: Status of each participant, i.e., whether they completed the study or dropped out.

Note: For privacy reasons, actual patient data is not included in this repository.

Scripts

  • dataCleaning.R: This script contains the data cleaning and preprocessing steps.
  • modelFitting_ctsem.R: This script includes the main analyses using CTSEM.

Requirements

The analysis was performed using R. Several packages are required to run the scripts, including ctsem, plyr, dplyr, tidyverse, ggplot2, and others. Please refer to the individual scripts for the full list of required packages.

Usage

To replicate the analysis, you should run the scripts in the following order:

  1. dataCleaning.R
  2. modelFitting_ctsem.R

Note: Make sure to adjust file paths and script paths according to your local environment.

Contact

Please open an issue for support or to report bugs.

License

This project is licensed under the terms of the USask license.

ctsem_suicide's People

Contributors

rifatzahan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.