npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

shukra

v3.2.4

Published

Compute meta-analytical statistics

Downloads

25

Readme

shukra

Tools for meta-analytical statistics, including Network Meta-Analysis (NMA), in NodeJS

Example

A fixed effects NMA on difference in means:

const { meanDifferenceNMA } = require('shukra/nma');

const studies = [1, 1, 2, 2, 2, 3, 3];
const trts = ['A', 'B', 'A', 'B', 'C', 'C', 'B'];
const means = [8, 10, 7, 10.5, 10.5, 10, 11];
const sds = [4.92, 3.87, 3.25, 6.35, 6.66, 4.32, 4.30];
const ns = [63, 45, 35, 44, 53, 75, 29];

const nma = meanDifferenceNMA(studies, trts, means, sds, ns, false);

nma.getEffect('A', 'B');
/*
-2.819
 */

nma.computeInferentialStatistics('A', 'B');
/*
{
  p: 0.000008,
  lowerBound: -4.06,
  upperBound: -1.58
}
*/   

Computing a pooled mean under random effects using inverse variance weighting:

const { pooledMean } = require('shukra/pooling');
pooledMean(ns, means, sds);
/*
{
  estimate: 9.493324459831722,
  lower: 8.334404617356348,
  upper: 10.652244302307096,
  studyEstimates: [
    { lower: 6.785093322564656, estimate: 8, upper: 9.214906677435344 },
    { lower: 8.86928592265621, estimate: 10, upper: 11.13071407734379 },
    { lower: 5.923293264578356, estimate: 7, upper: 8.076706735421643 },
    ...
  ]
}
*/

Install

Install the current release on npm:

npm install shukra

Install the most recent development version:

npm install --save https://github.com/holub008/shukra/tarball/master

About Shukra

shukra is a web targeted meta-analytical statistics toolkit. It was specifically designed for simplicity & speed over comprehensiveness (as in formal research publication); this means shukra can fit an NMA in the scope of a web request (<10 milliseconds).

shukra is developed for and by Nested Knowledge, but we welcome all users and contributions. It is predominantly transcribed from the meta and netmeta packages, and carries their licenses. These packages are also used for verifying correctness (see test/ for code samples).

The feature set is growing, but currently offers several modules:

  • NMA (shukra/nma)
    • Random & Fixed effects models
    • Mean Difference (continuous outcomes) & Odds Ratios (binomial outcomes)
    • Inferential statistics on effect size estimates and individual study point estimates
  • Pooling (shukra/pooling)
    • Inverse variance weighting
    • Random & Fixed effects models
    • Imputation of missing data
    • Inferential statistics on pooled estimates and individual study point estimates

About NMA

Network Meta-Analysis is a model for performing research synthesis. Given multi-arm (2+) studies, where each arm represents a discrete experimental treatment, and a measured outcome for each arm, an NMA produces an effect size estimate and associated inferential statistics.

NMA is exciting in that it models direct contrasts (i.e. head to head treatment comparisons in studies) and indirect evidence (i.e. using knowledge about A vs. B in one study and B vs. C in another to make inference on A vs. C).