-2
我想從下面的R輸出中提取單個統計數據。怎麼做?GOF物流模型R
# R code
library(pscl)
full <- glm(RESPONSE ~ as.factor(SEX) + TOTCHOL + AGE + ...,
data=training, family=binomial(link="logit"))
summary(full)
# McFadden's GOF pseudo R-squared, 0.2 to 0.4 indicates good model fit
McFadden=round(pR2(full),digits=4)['McFadden']; McFadden
輸出:
library(pscl)
round(pR2(reduced),digits=4)
llh llhNull G2 McFadden r2ML r2CU
-165.6085 -191.1523 51.0875 0.1336 0.0663 0.1651
錯誤:
pR2$McFadden
Error in pR2$McFadden : object of type 'closure' is not subsettable
我從來沒有使用這種['McFadden']的語法。非常感謝你。它有效... MM –