pbf | R Documentation |
Used in bfTest
. Distribution of the t-statistic used in
Welch's t-test. The distribution depends on the sample sizes of the two groups, and the ratio of the two standard errors of the means.
pbf(q, n1, n2, R = NULL, s1 = NULL, s2 = NULL, epsilon = 10^(-8))
qbf(p,n1,n2,R=NULL,s1=NULL,s2=NULL,epsilon=10^(-8))
q |
vector of quantiles |
p |
vector of probabilities |
n1 |
sample size in group 1 |
n2 |
sample size in group 2 |
R |
a function of the ratio of the two standard errors of the mean. Specifically,
|
s1 |
sample standard deviation in group 1 |
s2 |
sample standard deviation in group 2 |
epsilon |
a small positive number used to avoid computer errors |
The user must supply either s1
and s2
or supply R
.
Suppose m1 and m2 are the means of the two groups and D is the true difference in means. Then the Behrens-Fisher test statistic is
T=(m1-m2-D)/sqrt(s1/sqrt(n1)+ s2/sqrt(n2))
. The value T can be equivalently written as T=T1*sin(R)+T2*cos(R)
, where T1 and T2 are t random variables with n1-1 and n2-1 degrees of freedom. The cumulative distribution of T is found by numeric integration.
We rewrite Pr[T<=q]
as \int_{-Inf}^{Inf} Pr[T2<= (q-u*sin(R))/cos(R) | T1=u] Pr[T1=u] du
.
pbf gives the distribution function, qbf givds the quantile function.
Kim, S-H, and Cohen, AS (1996). Table of percentage points of the Behrens-Fisher distribution. Journal of Statistical Computation and Simulation. 55(3) 181-187.
# See Table 1 from Kim and Cohen, 1996
# at v1=n1-1=8 and v2=n2-1=12 with 45 degrees = 45*pi/180 radians
# for 0.95th percentile
# Table gives: 1.83496
qbf(0.95,9,13,45*pi/180)
# check Inf degrees of freedom, should give qnorm value
qbf(.95,Inf,Inf,45*pi/180)
qnorm(.95)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.