Coder Social home page Coder Social logo

lctmtools's Introduction

LCTMtools

Latent Class Trajectory Modelling Tools: an R Package

Maintainer: Hannah Lennon
Contact: [email protected]
Last Updated: March 2019

To install the R package, in the R console use the command

devtools::install_github("hlennon/LCTMtools")

All statistical (R and SAS) codes used to implement Latent Class Trajectory Modelling and the tools described in the manuscript "A framework to construct and interpret Latent Class Trajectory Modelling", are available here and can be downloaded from www.github.com/hlennon/LCTMtools.

An example (simulated) dataset 'bmi' and 'bmi_long' (long format version) is provided to describe the steps throughout.

Reference

Lennon H, Kelly S, Sperrin M, et al., Framework to construct and interpret Latent Class Trajectory Modelling, BMJ Open 2018;8:e020683.

Available at https://bmjopen.bmj.com/content/8/7/e020683

Help Files

There are two help manuals available above:

    1. The standard R manual detailing the input and outputs of each of the functions, called LCTMtools.pdf
    1. A vignette with a guided example, named LCTMtools-vignette.pdf

Brief Example

library(LCTMtools)
data(bmi_long, package = "LCTMtools" )


# Use the hlme function from the 'lcmm' R package to fit a 2 class latent class trajectory model
set.seed(100)
library(lcmm)
model2classes <- lcmm::hlme(fixed = bmi ~ age + I(age^2), 
                      mixture= ~ age, 
                      random = ~ age, 
                      ng = 2, 
                      nwg = TRUE,  
                      subject = "id", 
                      data = bmi_long[1:500, ] )


# Compute model adequacy measures
LCTMtoolkit(model2classes)


# Compare with a 3 class model
set.seed(100)
model3classes <- lcmm::hlme(fixed = bmi ~ age + I(age^2), 
                      mixture= ~ age, 
                      random = ~ age, 
                      ng = 3, 
                      nwg = TRUE,  
                      subject = "id", 
                      data = bmi_long[1:500, ] )


LCTMtoolkit(model3classes)

LCTMcompare(model2classes, model3classes)

Citation

Hannah Lennon. {LCTMtools}: Latent Class Trajectory Models tools R Functions. R package version 0.1.2.

Lennon H, Kelly S, Sperrin M, et al Framework to construct and interpret Latent Class Trajectory Modelling BMJ Open 2018;8:e020683. doi: 10.1136/bmjopen-2017-020683

Thanks

A special thank you to Charlotte Watson for testing.

Contributing

Iโ€™m happy to receive bug reports, suggestions, questions, and (most of all) contributions to fix problems and add features. I prefer you use the Github issues system over trying to reach out to me in other ways. Pull requests for contributions are encouraged.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

lctmtools's People

Contributors

hlennon avatar rdosreis avatar

Watchers

 avatar

Forkers

lixiccccc

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.