Giter Club home page Giter Club logo

samplesizecmh's Introduction

samplesizeCMH: Sample Size Calculation for the Cochran-Mantel-Haenszel Test

CRAN_version Number_of_Downloads

by Paul W. Egeler M.S.

Description

This package provides functions relating to power and sample size calculation for the CMH test. There are also several helper functions for interconverting probability, odds, relative risk, and odds ratio values.

Please see the package website for more information on how this package is used, including documentation and vignettes.

The Cochran Mantel Haenszel Test

The Cochran-Mantel-Haenszel test (CMH) is an inferential test for the association between two binary variables, while controlling for a third confounding nominal variable. Two variables of interest, X and Y, are compared at each level of the confounder variable Z and the results are combined, creating a common odds ratio. Essentially, the CMH test examines the weighted association of X and Y. The CMH test is a common technique in the field of biostatistics, where it is often used for case-control studies.

Sample Size Calculation

Given a target power which the researcher would like to achieve, a calculation can be performed in order to estimate the appropriate number of subjects for a study. The power.cmh.test function calculates the required number of subjects per group to achieve a specified power for a Cochran-Mantel-Haenszel test.

Power Calculation

Researchers interested in estimating the probability of detecting a true positive result from an inferential test must perform a power calculation using a known sample size, effect size, significance level, et cetera. The power.cmh.test function can compute the power of a CMH test, given parameters from the experiment.

Installation

Installation of the CRAN release can be done with install.packages(). From the R console:

install.packages("samplesizeCMH")

Downloading and installing the latest version from GitHub is facilitated by remotes. To do so, type the following into your R console:

if (!require("remotes")) install.packages("remotes")
remotes::install_github("pegeler/samplesizeCMH")

samplesizecmh's People

Contributors

pegeler avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

samplesizecmh's Issues

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.