desired_ep_d: Determines the required sample size in a future study to...

View source: R/desired_ep_d.R

desired_ep_dR Documentation

Determines the required sample size in a future study to achieve the desired expected power (ep) based on the uncertainty associated with an existing study. Uses the observed standardized mean difference from the previous study as input in the sample size planning process. Assumes both that the previous and future study will involve fixed predictors. If this is not the case, use the desired_ep_t() function for full flexibility.

Description

Determines the required sample size in a future study to achieve the desired expected power (ep) based on the uncertainty associated with an existing study. Uses the observed standardized mean difference from the previous study as input in the sample size planning process. Assumes both that the previous and future study will involve fixed predictors. If this is not the case, use the desired_ep_t() function for full flexibility.

Usage

desired_ep_d(
  d,
  n1,
  n2,
  desired_ep = 0.8,
  alpha = 0.05,
  filter = 0,
  upper_null = 0
)

Arguments

d

The observed standardized mean difference of the previous study based on a pooled standard deviation.

n1

The number of observations in the first group.

n2

The number of observations in the second group.

desired_ep

The desired expected power for the future study.

alpha

The significance level. Default is α = .05.

filter

The filter value reflects the probability of nonsignificant results being filtered. filter = 0 means that there is no filtering and you would have observed nonsignificant results. filter = 1 means that only significant results are observed and you would never have seen nonsigificant results if they had occurred. Filtering is based on alpha = .05 and assumes that are have observed a significant result. Filtering is conducted by weighting (actually filtering) the posterior distribution. For instance, if filter = 1, then the posterior of the null (i.e., the noncentrality parameter is 0) is up to 20 times more likely than when the noncentrality parameter is very large. Setting filter > 0 slows estimation.

upper_null

Specifies the upper value of the composite null hypothesis in units of the correlation coefficient eqnr. The default value of upper_null = 0 keeps the point null hypothesis. A value of, for instance, upper_null = .05 would remove all posterior values between -.05 and .05 from consideration when calculating expected power.

Value

Returns (1) the sample size per group required for the future study to achieve the specified level of expected power. This reflects the uncertainty associated with the previous study and (2) the median 95

Examples

## Not run: 
desired_ep_d(d = 0.50, n1=25, n2=25, desired_ep = 0.80)

## End(Not run)

jbiesanz/fabs documentation built on July 15, 2022, 11:02 p.m.