TDist(stats)
TDist()所属R语言包:stats
The Student t Distribution
学生t分布
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Density, distribution function, quantile function and random generation for the t distribution with df degrees of freedom (and optional non-centrality parameter ncp).
密度分布函数,位数df自由度(和可选的非集中参数ncp)t分布的函数和随机生成的。
用法----------Usage----------
dt(x, df, ncp, log = FALSE)
pt(q, df, ncp, lower.tail = TRUE, log.p = FALSE)
qt(p, df, ncp, lower.tail = TRUE, log.p = FALSE)
rt(n, df, ncp)
参数----------Arguments----------
参数:x, q
vector of quantiles.
位数的向量。
参数:p
vector of probabilities.
概率向量。
参数:n
number of observations. If length(n) > 1, the length is taken to be the number required.
观测数。如果length(n) > 1,长度是所需的数量。
参数:df
degrees of freedom (> 0, maybe non-integer). df = Inf is allowed.
自由度(> 0,也许非整数)。 df = Inf是允许的。
参数:ncp
non-centrality parameter delta; currently except for rt(), only for abs(ncp) <= 37.62. If omitted, use the central t distribution.
非集中参数delta;目前除rt(),只为abs(ncp) <= 37.62。如果省略,用中央的t分布。
参数:log, log.p
logical; if TRUE, probabilities p are given as log(p).
逻辑;如果为TRUE,概率P日志(P)。
参数:lower.tail
logical; if TRUE (default), probabilities are P[X ≤ x], otherwise, P[X > x].
逻辑;如果是TRUE(默认),概率P[X ≤ x],否则,“P[X > x]。
Details
详情----------Details----------
The t distribution with df = n degrees of freedom has density
的tdf= n自由度的分布密度
for all real x. It has mean 0 (for n > 1) and variance n/(n-2) (for n > 2).
所有真正的x。它意味着0(n > 1)和方差n/(n-2)(n > 2)。
The general non-central t with parameters (df, Del) = (df, ncp) is defined as the distribution of T(df, Del) := (U + Del) / √(V/df) where U and V are independent random variables, U ~ N(0,1) and V ~ χ^2(df) (see Chisquare).
一般非中央t参数(df, Del)= (df, ncp)被定义为T(df, Del) := (U + Del) / √(V/df) 其中U和V是独立的随机变量的分布, U ~ N(0,1)和V ~ χ^2(df)(卡方)。
The most used applications are power calculations for t-tests:<br> Let T= (mX - m0) / (S/sqrt(n)) where mX is the mean and S the sample standard deviation (sd) of X_1, X_2, …, X_n which are i.i.d. N(μ, σ^2) Then T is distributed as non-central t with df= n - 1 degrees of freedom and non-centrality parameter ncp = (μ - m0) * sqrt(n)/σ.
最常用的应用程序t测试的功率计算:参考让T= (mX - m0) / (S/sqrt(n))其中mX是mean和S样本的标准偏差( sd)X_1, X_2, …, X_n这是独立同分布N(μ, σ^2)然后T分布非中央tdf = n - 1度的自由和非核心参数ncp“ = (μ - m0) * sqrt(n)/σ 。
值----------Value----------
dt gives the density, pt gives the distribution function, qt gives the quantile function, and rt generates random deviates.
dt给人的密度,pt给出了分布函数,qt给人的分量功能,rt产生随机的偏离。
Invalid arguments will result in return value NaN, with a warning.
无效的参数将导致返回值NaN,一个警告。
注意----------Note----------
Supplying ncp = 0 uses the algorithm for the non-central distribution, which is not the same algorithm used if ncp is omitted. This is to give consistent behaviour in extreme cases with values of ncp very near zero.
供应ncp = 0使用算法的非中心分布,这是不使用相同的算法,如果ncp省略。这是给予一致的行为,在极端情况下ncp非常接近零值。
The code for non-zero ncp is principally intended to be used for moderate values of ncp: it will not be highly accurate, especially in the tails, for large values.
为非零ncp代码主要拟用于适度值ncp:它不会是非常准确的,尤其是在尾巴大值。
源----------Source----------
The central dt is computed via an accurate formula provided by Catherine Loader (see the reference in dbinom).
中央dt通过由凯瑟琳装载机提供了一个准确的公式(见参考dbinom)计算。
For the non-central case of dt, C code contributed by Claus Ekstr鴐 based on the relationship (for x != 0) to the cumulative distribution.
非中央为dt的情况下,C代码贡献由克劳斯Ekstr?基于m累积分布的关系(x != 0)。
For the central case of pt, a normal approximation in the tails, otherwise via pbeta.
中央为pt,在正常的尾巴逼近,否则,通过pbeta的情况。
For the non-central case of pt based on a C translation of
对于非中央pt基于一个C翻译情况
Lenth, R. V. (1989). Algorithm AS 243 — Cumulative distribution function of the non-central t distribution, Applied Statistics 38, 185–189.
全长,R.五(1989年)。 AS 243 - 非中央t分布的累积分布函数的算法,应用统计38,185-189。
This computes the lower tail only, so the upper tail suffers from cancellation and a warning will be given when this is likely to be significant.
这仅计算较低的尾巴,所以尾巴上遭受取消时,这是很大的,将给予警告。
For central qt, a C translation of
对于中央qt,一个C翻译
Hill, G. W. (1970) Algorithm 396: Student's t-quantiles. Communications of the ACM, 13(10), 619–620.
山,毛重(1970)396算法:学生的t-位数。通信的ACM,13(10),619-620。
altered to take account of
修改,以顾及
Hill, G. W. (1981) Remark on Algorithm 396, ACM Transactions on Mathematical Software, 7, 250–1.
山,GW(1981)注396算法,数学软件,7 250-1 ACM交易。
The non-central case is done by inversion.
非中央的情况下进行反演。
参考文献----------References----------
The New S Language. Wadsworth & Brooks/Cole. (Except non-central versions.)
Continuous Univariate Distributions, volume 2, chapters 28 and 31. Wiley, New York.
参见----------See Also----------
Distributions for other standard distributions, including df for the F distribution.
其他标准分布,包括df F分布的分布。
举例----------Examples----------
require(graphics)
1 - pt(1:5, df = 1)
qt(.975, df = c(1:10,20,50,100,1000))
tt <- seq(0,10, len=21)
ncp <- seq(0,6, len=31)
ptn <- outer(tt,ncp, function(t,d) pt(t, df = 3, ncp=d))
t.tit <- "Non-central t - Probabilities"
image(tt,ncp,ptn, zlim=c(0,1), main = t.tit)
persp(tt,ncp,ptn, zlim=0:1, r=2, phi=20, theta=200, main=t.tit,
xlab = "t", ylab = "non-centrality parameter",
zlab = "Pr(T <= t)")
plot(function(x) dt(x, df = 3, ncp = 2), -3, 11, ylim = c(0, 0.32),
main="Non-central t - Density", yaxs="i")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|