更新: 2018-01-16 12:26:08
生態学のデータ解析 - summary(glm()) の星
- R の
glm()
のsummary
の係数の推定値の表 (table of coefficients) について - 参照: FAQ 一般化線形モデル, GLM 参照
(まだ書きかけです)
[項目]
「星」がつく? つかない?
-
glm()
の推定結果をsummary()
すると係数 (coefficieints) の推定値に関する table が表示されます.
Call: glm(formula = y ~ x + f, family = poisson, data = d) Deviance Residuals: Min 1Q Median 3Q Max -2.3978 -0.7337 -0.2023 0.6795 2.4317 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 1.26311 0.36963 3.417 0.000633 *** x 0.08007 0.03704 2.162 0.030620 * fT -0.03200 0.07438 -0.430 0.667035 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for poisson family taken to be 1)
-
ただし R のオプション指定で,
show.signif.stars
がFALSE
になっていると, 「星」は表示されません.
Call: glm(formula = y ~ x + f, family = poisson, data = d) Deviance Residuals: Min 1Q Median 3Q Max -2.398 -0.734 -0.202 0.679 2.432 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 1.2631 0.3696 3.42 0.00063 x 0.0801 0.0370 2.16 0.03062 fT -0.0320 0.0744 -0.43 0.66703 (Dispersion parameter for poisson family taken to be 1)
-
show.signif.stars
設定が影響する関数 -
summary.glm()
を表示するprint.summary.glm()
(関数はgetS3method("print", "summary.glm")
で表示できる --- 参照methods(print)
) -
係数の table を表示する
printCoefmat()
関数
show.signif.stars
の設定
-
show.signif.stars
はどう設定するか?-
options(show.signif.stars = FALSE)
(参照 help(options)) - あるいは Rprofile ファイルに
options(show.signif.stars = FALSE)
-
R-help 上での議論
- 係数の推定値に "significancy" に関連して,
show.signif.stargs
をデフォルトでFALSE
にすべきでは? といった議論が R-help であった (2000 年 9 月ごろ)- https://stat.ethz.ch/pipermail/r-help/2000-September/thread.html#8390 から始まる議論
- Thread が途中でつけかわってますが
- https://stat.ethz.ch/pipermail/r-help/2000-September/thread.html#8390 から始まる議論
- 久保が気に入ったコメント,いくつか (かきかけ)
- JAGS を作った Martin Plummer さん (https://stat.ethz.ch/pipermail/r-help/2000-September/008396.html)
- MASS 本 の著者のひとり Bill Venables さん (https://stat.ethz.ch/pipermail/r-help/2000-September/008400.html)
-
MASS 本のもうひとりの著者,Brian Ripley 御大の
ないす なコメント
(
show.signif.stars
が default でTRUE
になっていることに関して; https://stat.ethz.ch/pipermail/r-help/2000-September/008446.html)
I would hope that you never conduct an analysis without knowing what the variables mean!
I accept full responsibilty... and I am sticking to my guns. I think this is a crucial point of inference often misunderstood. It is at the core of the reason why putting significance stars routinely on t-statistics is NOT a good idea - by doing so you encourage confusion and unjustified inferences.
Let me start to answer by asking you "What does a `significant' t-test result mean?" To me it means that if someone were to pose the null hypothesis that the mean (or in this case regression coefficient) were zero, you would have, by convention, strong enough evidence to reject it. If the result were `non-significant', by contrast, it does NOT allow you to assert that the regression coefficient IS zero, it only means that you do not have enough EVIDENCE to reject such a claim. The real question is whether or not it is a claim anyone would have good reason to make in the first place - sometimes it would be, sometimes not. In the case above I would say from the context there is no good reason for anyone a priori to claim that the derivative at temperature 0 should be zero, that is, that the curve should necessarily be flat at that rather arbitrary point.
I always forget that that they are turned on by default, for I haveauk% cat ~/.Rprofile options(show.signif.stars=FALSE) ps.options(horizontal=FALSE)and so never see them.