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 |
|
df |
Degrees of freedom. |
nsamp |
Sample size. For a two-sample test, this should be a vector of length 2. |
pval |
|
delta |
If not |
sd |
Standard deviation. |
twoSided |
Set either to |
showMax |
Set to |
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
t -
t
-statisticdf - Degrees of freedom
pval - P-value
likDelta - Likelihood, given difference delta under H0
lrDelta - Likelihood ratio, given difference delta under H0
maxlik - Maximum likelihood, under allowed alternatives H1
lrmax - Maximum likelihood under H1, on the scale of the $t$-statistic
tmax -
t
-statistic for difference in means that makes likelihood under H1 a maximum
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)