safeTTestStatAlpha {safestats}R Documentation

safeTTestStat() Subtracted with 1/alpha.

Description

This is basically just safeTTestStat() - 1/alpha. This function is used for root finding for pilot designs.

Usage

safeTTestStatAlpha(
  t,
  parameter,
  n1,
  n2 = NULL,
  alpha,
  alternative = c("twoSided", "greater", "less"),
  tDensity = FALSE
)

Arguments

t

numeric that represents the observed t-statistic.

parameter

numeric this defines the safe test S, i.e., a likelihood ratio of t distributions with in the denominator the likelihood with delta = 0 and in the numerator an average likelihood defined by 1/2 time the likelihood at the non-centrality parameter sqrt(nEff)*parameter and 1/2 times the likelihood at the non-centrality parameter -sqrt(nEff)*parameter.

n1

integer that represents the size in a one-sample t-test, (n2=NULL). When n2 is not NULL, this specifies the size of the first sample for a two-sample test.

n2

an optional integer that specifies the size of the second sample. If it's left unspecified, thus, NULL it implies that the t-statistic is based on one-sample.

alpha

numeric > 0 only used if pilot equals TRUE. If pilot equals FALSE, then the alpha of the design object is used instead in constructing the decision rule S > 1/alpha.

alternative

a character only used if pilot equals TRUE. If pilot equals FALSE, then the alternative specified by the design object is used instead.

tDensity

Uses the the representation of the safe t-test as the likelihood ratio of t densities.

Value

Returns a numeric that represent the e10 - 1/alpha, that is, the e-value in favour of the alternative over the null - 1/alpha.

Examples

safeTTestStat(t=1, n1=100, 0.4)
safeTTestStat(t=3, n1=100, parameter=0.3)

[Package safestats version 0.8.7 Index]