Giter Club home page Giter Club logo

samuel-watson / clusterapp Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 0.0 16.63 MB

ClusterApp is a general, standalone, graphic cluster trials designer application. Trial designs are created graphically and multiple analyses and calculations are updated in real-time. Features include power analysis, design effects, optimal designs, power surfaces, open cohorts, factorial designs, and dose response designs.

License: GNU General Public License v3.0

Makefile 0.09% C++ 77.32% C 10.46% HTML 0.23% JavaScript 11.90%

clusterapp's Introduction

ClusterApp

An application for design analysis for cluster randomised trials. The application provides an interactive graphical user interface to design a cluster trial, set model parameters, identify optimal designs, and determine power. A wide range of models are provided for both fixed and random effects, including exchangeable, nested exchangeable, and exponential decay covariance models at cluster and individual levels; Gaussian, binomial, poisson, beta, and gamma models with a range of link functions; and, time fixed effects and cluster time trends. Power, confidence intervals, and standard errors are calculated using GLS covariance and with between-within and Kenward-Roger corrections. Optimal design weights are calculated using the "Girling" algorithm. The app also include two treatment designs including factorial trials.

The app is available online at clustertrial.app.

Using the app

The windows can be moved around and docked using the dockspace as shown in the image above. Click and drag via the title bar of each window to use the dockspace. The dockspace can also be disabled in Windows->Dockspace. The Windows menu can be used to show/hide the different windows.

The designer window (left windown in the screenshot) has several ways of interacting with it. You can click individual cluster/sequence-periods to modify its active and treatment statuses, as well as its number of observations. Clicking the row or column headers will allow control over all cluster/sequence-periods in that column or row and provides the option to delete columns and rows. The + symbols allow you to add rows and columns. The menu Trial Designs provide a range of pre-specified trial designs with various options and Modify Design provides several ways of editing all the cluster/sequence-periods in the design. The Statistical Model window (right window in the screenshow) provides all the controls for editing the model and is where the parameter values, including the treatment effect can be modified. The results and optimal design windows update automatically; a check is performed once a second for any changes and if any are detected then the calculations will be updated automatically. The optimal design window (middle top) shows the optimal design weights for each cluster-period; clicking on the cells in this design will show the weights and a total number of observations using Hamilton's rounding method. The Apply design button, will apply the optimal design to the trial designer window. Finally, the results window (middle bottom) shows the power, confidence interval width, and other information.

To enable factorial designs and other designs with two treatments select Trial designs->Two treatments. When there are two treatments, the model will include the individual treatment indicators and their interaction. Cells with the second treatment are coloured yellow, and the interaction are both red/yellow. The results window will show results for both treatments and the interaction, as below. In addition, there are also options for dose response designs with a linear treatment effect and heterogeneous treatment effects including treatment indicator random effects.

Other features

There are a range of other features that can be accessed through the menu View->Windows. These include: optimal design weights, sample minimization, sample size summaries, and plotting functions.

Future features

The application is still in development stage and may have bugs. For upcoming versions we plan to implement the following features:

  • Heterogeneous treatment effects including random effect treatment terms and treatment by time interactions.
  • Cluster-specific linear and polynomial time trends.
  • Continuous time models including continuous enrollment.
  • Combinatorial optimisation algorithms (with animation!).
  • Exporting of trial design diagrams.
  • Restricted randomisation methods and model adjustment.
  • (More distant future) Bayesian trial design analysis including statistics like average posterior variance.

Software

The underlying GLMM library is our own glmmr library, which is also provided as an R package, which is available on CRAN as glmmrBase and glmmrOptim. The glmmr website provides tutorials and examples of using the R package. The folder src/glmmr contains all the header files and can be ported to other projects. The GUI is built using Dear ImGui.

Compilation

The application is built using Emscripten, which compiles C/C++ code to WebAssembly. The project also requires the libraries Eigen and Boost. These are header only librarys, along with ImGui. To build the project change IMGUI_DIR, EIGEN_DIR, and BOOST_DIR in the makefile to the relevant paths for the respective libraries. Then the application can be built using

emmake make

on Linux/MacOS or

emmake mingw32-make

on Windows systems, assuming MinGW is the compiler. Similarly, the project can be built as a standalone application.

References and useful links

clusterapp's People

Contributors

samuel-watson avatar

Stargazers

 avatar Edin Mujagic avatar Adam Kewley avatar 捏捏口 avatar Tomas Vybiral avatar Lance Li avatar  avatar

Watchers

 avatar

clusterapp's Issues

Menu buttons have no effect

The following menu buttons do not have an effect:

  • Update sample size for optimiser
  • Set n per cluster-period for all cluster-periods

Crash when multiple time periods and factorial trial

The app crashes when including more than one time period with a factorial trial either using the Factorial->Set menu option or adding time periods to a factorial trial in the designer.

Uncaught RuntimeError: Aborted(Assertion failed: row >= 0 && row < rows() && col >= 0 && col < cols(), at: C:/cpp/eigen/eigen-3.4.0\Eigen/src/Core/DenseCoeffsBase.h,367,operator()). Build with -sASSERTIONS for more info.

Features to add

  • Heterogeneous time effects, i.e. random effects for time parameters
  • Heterogeneous treatment effects, i.e. random effects for treatment effects
  • Time averaged effects
  • #7
  • #6
  • Manual updating (switch of automatic updating for big designs)
  • Stepped-wedge with implementation period
  • Simplify statistical model interface option
  • Varying cluster sizes determined by coefficient of variation

Move to glmmrBase 0.5.2

Update glmmrBase to 0.5.2 to use new features. Suggest also compilation with -fno-math-errno flag as it makes a huge difference to performance.

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.