tTOlr {tTOlr}R Documentation

Maximum Likelihood ratio for H1 versus H0, given t-statistic or p-value

Description

Given the t-statistic for a difference in means, or for a mean difference, and degrees of freedom, determine the maximum likelihood under the alternative H1, and the $t$-statistic for the difference in means that makes the likelihood under H1 a maximum. Also available is the likelihood that corresponds to a particular value of a particular effect size (mean divided by standard deviation) delta.

Usage

tTOlr(
  t = NULL,
  df = NULL,
  nsamp = NULL,
  pval = NULL,
  delta = NULL,
  sd = 1,
  twoSided = TRUE,
  showMax = TRUE
)

Arguments

t

t-statistic. If NULL, this is calculated from the p-value.

df

Degrees of freedom.

nsamp

Sample size. For a two-sample test, this should be a vector of length 2.

pval

p-value. If NULL, this is calculated from the t-statistic and degreesĀ of freedom.

delta

If not NULL, this specifies the $t$-statistic for the difference from H0 that is of interest, allowing the calculation of the corresponding likelihood and likelihood ratio.

sd

Standard deviation.

twoSided

Set either to TRUE for a two-sided test, or FALSE for a one-sided test.

showMax

Set to TRUE if the maximum of the likelihood and the likelihood ratio is required.

Details

The function returns the maximum likelihood estimate of the maximum likelihood on the scale of the $t$-statistic, for the likelihood under the alternative, when the when the $t$-statistic is used as non-centrality parameter. This results in a value for the likelihood ratio that differs from (and is smaller than) the standard likelihood ratio statistic. Additionally, return the likelihoods under H0 and H1.

Value

List, with elements

Note

The likelihood estimate for H1 versus H0 is unchanged if the roles of H0 and H1 are reversed.

Examples

likStats <- tTOlr(pval=0.02, nsamp=c(9,9), twoSided=TRUE,
                delta=1.4, sd=1.2)
print(likStats,digits=2)
likStats <- tTOlr(t=2.58, df=16, nsamp=c(9,9), twoSided=TRUE,
                  delta=1.4, sd=1.2)
print(likStats,digits=2)
likStats <- tTOlr(pval=0.02, nsamp=9, twoSided=FALSE,
                delta=1.4, sd=1.2)
print(likStats,digits=2)
likStats <- tTOlr(t=2.45, df=8, nsamp=9, twoSided=FALSE,
                  delta=1.4, sd=1.2)
print(likStats,digits=2)


[Package tTOlr version 0.2.3 Index]