• R语言
  • R做回归怎么把小于2e-16的Pr(>|t|)显示出来?

R做回归怎么把小于2e-16的Pr(>|t|)显示出来?

回复 第1楼 的 xiekunwhy:

真的需要吗?这个一般是计算机的精度限制。

回复 第2楼 的 Ihavenothing:需要的,我要作图,Pr(>|t|)越精细越好,有什么好办法吗?

回复 第3楼 的 xiekunwhy:

这种情况可以直接当成0了,就好像是说正态分布100个标准差以外的概率是多少。

回复 第4楼 的 Ihavenothing:我还是直接当成2e-16吧,当0的话不能-log10(),谢谢您啊!

回复 第5楼 的 xiekunwhy:options(digits=20)??如果是

lm内部已经做了近似,那貌似没办法了...比如它做出p=0.0234返回p=0.0200那怎么显示?

如果你关心的话,可以精确显示出来:

<br />
mydf = data.frame(x=1:100, y=1:100)<br />
lm.ret = lm(y~x, data=mydf)<br />
print(summary(lm.ret)$coefficients, digits=10)<br />
</p>

但是,这么小的P值,受机器精度(32 or 64)、操作系统、R版本、算法等因素影响很大。

我在不同系统下得到的结果都有差异。

Windows,R 3.0

<br />
                    Estimate      Std. Error          t value        Pr(>|t|)<br />
(Intercept) -1.121325255e-14 8.247248147e-16 -1.359635644e+01 2.743556267e-24<br />
x            1.000000000e+00 1.417835910e-17  7.053002347e+16 0.000000000e+00<br />
</p>

FreeBSD, R 2.15

<br />
                    Estimate      Std. Error          t value        Pr(>|t|)<br />
(Intercept) -5.684341886e-14 5.598352098e-15 -1.015359839e+01 5.618494122e-17<br />
x            1.000000000e+00 9.624476551e-17  1.039017545e+16 0.000000000e+00<br />
</p>

不过,幸亏不受气温、震动、时间、人员等因素的影响,否则就得按照科学实验的标准,严格随机分组、对照、重复原则来做计算了[s:11]

早期的机械计算机,装在战斗机上,不断干扰震动,反而算得更精确些,着实令工程师们困惑了一番。

楼上是对的

scale太大或者太小的系统 都不适合做这样精细的定量研究

回复 第6楼 的 superdesolator:是的,我提出来以后出现0.000000000e+00,应该就是已经近似了的!

回复 第7楼 的 doctorjxd:我自己鼓捣了,结果和7楼说的一样,但是有些值如0.000000000e+00就没办法了……

回复 第8楼 的 doctorjxd:呵呵,我挠它,给它挠痒痒,让它震动……;不过为什么在excel都可以算出1e-27以下的,在R中反而精细不出来呢?

回复 第13楼 的 xiekunwhy:

关于Excel的精度,请自行搜索下面的标题:

On the accuracy of statistical procedures in Microsoft Excel 2010

回复 第13楼 的 xiekunwhy:EXCEl可是jobs设计的!![s:11]

回复 第16楼 的 superdesolator:

可惜老乔不是统计学家,

[quote]

On the accuracy of statistical procedures in Microsoft Excel 2010

Guy M´ELARD

ECARES and Solvay Brussels School of Economics and Management, Universit´e libre de Bruxelles, CP114/4 Avenue Franklin Roosevelt 50, B-1050 Bruxelles, Belgium.

Abstract

All previous versions of Microsoft Excel have been criticized by statisticians for several reasons, including the accuracy of statistical functions, the properties of random number generator, the quality of statistical add-ins, the weakness of the Solver for nonlinear regression, and the data graphical representation.

We provide an update of these studies given the recent release of Excel 2010 and we have added OpenOffice.org Calc 3.3 and Gnumeric 1.10.16 to the analysis, for the purpose of comparison.

Keywords:

statistical function, statistical procedure, random number generator,

nonlinear regression, Excel 2010, OpenOffice.org Cal 3.3, Gnumeric

[/quote]

注意普朗克常数是10^-34,从某种意义上来说,小于这个级别的量都应该是测不到的

哪位好心人解释一下,Pr(>|t|)和t

11 天 后

如果楼主不是处女座的话,我就不能理解这个帖子的意思了。