View source: R/ss_buc_one_sample_t.R
| ss_buc_one_sample_t | R Documentation |
ss_buc_one_sample_t returns the necessary total sample
size to achieve a desired level of statistical power for a planned study
using a one-sample t test, based on information obtained from a
previous study. The effect from the previous study can be corrected for
publication bias and/or uncertainty to provide a sample size that will
achieve more accurate statistical power for a planned study, when compared
to approaches that use a sample effect size at face value or rely on sample
size only. The bias and uncertainty adjusted previous study noncentrality
parameter is also returned, together with the planning effect size, the
effect size the plan is built on, as a standardized mean.
ss_buc_one_sample_t(
t_observed,
N,
alpha_prior = 0.05,
alpha_planned = 0.05,
assurance = 0.8,
desired_power = 0.8
)
t_observed |
Observed t value from a previous study used to plan sample size for a planned study. Either sign is accepted: the publication rule is two-sided, so only the magnitude enters the correction. |
N |
Total sample size of the previous study. |
alpha_prior |
The significance level |
alpha_planned |
Alpha level |
assurance |
Desired level of assurance: the long run proportion of
planned studies whose statistical power at the true effect reaches or
surpasses |
desired_power |
Desired level of statistical power for the planned
study: the probability that its test rejects the null hypothesis when
the effect is present (Maxwell, Delaney, & Kelley, 2027). It must exceed
|
The one-sample t test and the dependent (paired) t
test are the same test applied to a single column of scores (Maxwell,
Delaney, & Kelley, 2027): the statistic has N - 1 degrees of
freedom and a noncentrality parameter of d\sqrt{N}.
ss_buc_one_sample_t therefore performs exactly the computation
ss_buc_paired_t performs, and reports it with a
one-sample design label and a total sample size rather than a number of
pairs. See ss_buc_paired_t for the full description of the
method, the meaning of assurance, the role of alpha_prior,
and what happens when the corrected noncentrality parameter is zero.
The returned actual_power is the statistical power of the plan
this function reports: the power of a study of the returned sample size
when the effect is the returned bias and uncertainty adjusted
noncentrality parameter. Because a sample size must be a whole number,
actual_power is never below the desired_power that was
requested and is usually a little above it.
The observed t may be entered with either sign; the publication rule the correction assumes is two-sided, so only the magnitude enters the computation.
If you are working from a standardized mean (Cohen's d) rather than
a t statistic, convert it before calling:
t = d\sqrt{N}.
An object of class bucss_plan: a data.frame with a
character term column and a numeric value column, in the
same shape as the sibling package DMAR's planners. The design
results come first: the necessary total sample size for the planned
study, named for its unit (necessary_n_per_group,
necessary_n_per_cell, or necessary_N); for the per-group
and per-cell designs, total_N, the implied total sample size;
actual_power, the power of the plan returned, that is, of the
returned sample size at the returned noncentrality parameter (see
Details); ncp_adjusted, the publication bias and uncertainty
adjusted prior study noncentrality parameter, on the scale of the t statistic (the noncentrality parameter of the prior study's noncentral t); and the
planning effect size, std_mean_planning, the standardized mean (the distance of the mean from its null value in standard deviations, a magnitude), \lambda/\sqrt{N}, where \lambda is ncp_adjusted and N the prior sample size; it is the dz_planning of ss_buc_paired_t under the one-sample name.
A planning effect size (the row whose name ends in _planning) is
an adjusted effect size: the value, in the design's usual effect size
metric, used to plan the sample size given the situation at hand (the
prior study's result, the publication bias assumed through
alpha_prior, and the uncertainty allowed for through
assurance). It is ncp_adjusted restated in that metric
and is what the plan is built on, not an estimate of the population
effect to report: above an assurance of .5 it is deliberately
conservative (a lower confidence limit), and at .5 it is the median
unbiased estimate. Because it restates ncp_adjusted,
actual_power is the ordinary power of a study of the returned
sample size when the population effect is the planning effect size.
Rows echoing the planning inputs follow the design results, so the
assumptions travel with the result. The design, the unit the sample size
is counted in, the largest assurance this prior can support (the assurance
ceiling), and the planned test's degrees of freedom (df_effect, and
df_error where the test has a denominator) travel on attributes.
print.bucss_plan shows the design, for the regression planners the
predictor frame, the unit, and the ceiling beneath the table;
tidy() and glance() give the compact and wide views, the
latter with every attribute as a column.
Ken Kelley (kkelley@nd.edu) and Samantha F. Anderson (samantha.f.anderson@asu.edu)
Anderson, S. F., & Kelley, K. (2024). Sample size planning for replication studies: The devil is in the design. Psychological Methods, 29, 844–867. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1037/met0000520")}
Anderson, S. F., Kelley, K., & Maxwell, S. E. (2017). Sample-size planning for more accurate statistical power: A method adjusting sample effect sizes for publication bias and uncertainty. Psychological Science, 28, 1547–1562. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1177/0956797617723724")}
Anderson, S. F., & Maxwell, S. E. (2017). Addressing the "replication crisis": Using original studies to design replication studies with appropriate statistical power. Multivariate Behavioral Research, 52, 305–324. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/00273171.2017.1289361")}
Kelley, K., & Maxwell, S. E. (2003). Sample size for multiple regression: Obtaining regression coefficients that are accurate, not simply significant. Psychological Methods, 8, 305–321. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1037/1082-989X.8.3.305")}
Maxwell, S. E., Delaney, H. D., & Kelley, K. (2027). Designing experiments and analyzing data: A model comparison perspective (4th ed.). Routledge.
Taylor, D. J., & Muller, K. E. (1996). Bias in linear model power and sample size calculation due to estimating noncentrality. Communications in Statistics: Theory and Methods, 25, 1595–1610. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/03610929608831787")}
ss_buc_paired_t, which performs the identical
computation for a paired design.
result <- ss_buc_one_sample_t(t_observed = 3, N = 40, alpha_prior = .05,
alpha_planned = .05, assurance = .80, desired_power = .80)
result
# Requesting more assurance than the prior result can support stops with an
# informative error naming the largest workable assurance (here near .90):
try(ss_buc_one_sample_t(t_observed = 3, N = 40, assurance = .95))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.