Code Monkey home page Code Monkey logo

power's Introduction

The power package

Lifecycle: experimental CRAN status

The goal of the power package is to โ€ฆ

Installation

You can install the released version of power from CRAN with:

remotes::install_github("stufield/power")

Loading power

library(power)

Plot power curves

plotPowerCurves(effect = seq(0.5, 2, 0.1), power.vec = seq(0.5, 0.9, 0.1))

Plot power simulations

# constant effect size
# must pass `nboot=`
set.seed(1)
size <- simulatePowerData(seq(10, 50, 2), delta = 1.2, nboot = 25)
size
#> **Simulation Info:**
#> 
#> Simulation table dims               25 x 21
#> Simulations per Power calculation   25
#> Simulating across (varying)         n
#> Varying sequence                    10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50
#> Constant                            delta = 1.2
#> Simulation repeats                  25

# plot
plot(size)

# constant sample size
set.seed(2)
delta <- simulatePowerData(seq(0.5, 2.5, 0.1), n = 20, nboot = 25)
delta
#> **Simulation Info:**
#> 
#> Simulation table dims               25 x 21
#> Simulations per Power calculation   25
#> Simulating across (varying)         delta
#> Varying sequence                    0.5,0.6,0.7,0.8,0.9,1,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2,2.1,2.2,2.3,2.4,2.5
#> Constant                            n = 20
#> Simulation repeats                  25

# plot
plot(delta)

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.