Learn R Programming

preference (version 1.1.6)

sample_size: Preference trial parameter accessors

Description

Accessor function have been created to get the sample size (sample_size), power (power), effect size (effect_size), arm proportion (proportion), significance (significance), and trial variance estimates (sigma2) for a set of preference trials.

Note that these methods are preferred over accessing the underlying data frame directly since the structure is slightly non-standard (some columns are lists) and some values, like power, are not stored directly.

Usage

sample_size(x)

# S3 method for preference.trial sample_size(x)

power(x)

# S3 method for preference.trial power(x)

effect_size(x)

# S3 method for preference.trial effect_size(x)

proportion(x)

# S3 method for preference.trial proportion(x)

significance(x)

# S3 method for preference.trial significance(x)

sigma2(x)

# S3 method for preference.trial sigma2(x)

Arguments

x

the set of preference trials.

Examples

Run this code
# NOT RUN {
# Create a set of trials with a sequence of preference effects.
trials <- preference.trial(pref_ss=100, pref_effect=seq(0.1, 2, by=0.5), 
                           selection_ss=100, selection_effect=1, 
                           treatment_ss=100, treatment_effect=1, sigma2=1, 
                           pref_prop=0.6)

# the sample sizes
sample_size(trials)

# the powers
power(trials)

# the effect sizes
effect_size(trials)

# the arm proportions
proportion(trials)

# the significance
significance(trials)

# the variance estimates
sigma2(trials)

# }

Run the code above in your browser using DataLab