binDesign_tidiers {broom} | R Documentation

## Tidy a binDesign object

### Description

Tidy a binDesign object from the "binGroup" package, which determines the sample size needed for a particular power.

### Usage

    ## S3 method for class 'binDesign'
    tidy(x, ...)

    ## S3 method for class 'binDesign'
    glance(x, ...)

### Arguments

`x` | A "binDesign" object
`...` | Extra arguments (not used)

### Value

All tidying methods return a data.frame without rownames, whose structure depends on the method chosen.

The `tidy` method returns a data.frame with one row for each iteration that was performed, with columns

`n` | Number of trials in this iteration
`power` | The power achieved for this n

The `glance` method returns a one-row data.frame with columns

`power` | The power achieved by the analysis
`n` | The sample size used to achieve this power
`power.reached` | Whether the desired power was reached
`maxit` | Number of iterations performed

### Examples

    if (require("binGroup", quietly = TRUE)) {
        des <- binDesign(nmax = 300, delta = 0.06,
                         p.hyp = 0.1, power = .8)

        glance(des)
        head(tidy(des))

        # the ggplot2 equivalent of plot(des)
        library(ggplot2)
        ggplot(tidy(des), aes(n, power)) +
            geom_line()
    }

[Package broom version 0.4.1 Index]