Learn R Programming

broom (version 0.4.3)

binDesign_tidiers: 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 binDesign
tidy(x, ...)

# S3 method for 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

Run this code
# NOT RUN {
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()
}
# }

Run the code above in your browser using DataLab