glm 모델의 적합성을 설명하는 p 값 하나를 얻는 방법을 찾고 있습니다. 하나의 ID가 GLM과 같은 행동을 할 경우glm 모델에 대한 하나의 p 값
Call:
lm(formula = weight ~ group + conf)
Residuals:
Min 1Q Median 3Q Max
-1.17619 -0.40373 -0.05262 0.24987 1.40777
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.97416 0.25153 19.775 3.6e-13 ***
groupTrt -0.23724 0.41117 -0.577 0.572
conf -0.07044 0.13725 -0.513 0.614
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.7111 on 17 degrees of freedom
Multiple R-squared: 0.08722, Adjusted R-squared: -0.02017
F-statistic: 0.8122 on 2 and 17 DF, p-value: 0.4604
이
glm.D9 <- glm(weight ~ group + conf)
summary(glm.D9)
내가
Call:
glm(formula = weight ~ group + conf)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.17619 -0.40373 -0.05262 0.24987 1.40777
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.97416 0.25153 19.775 3.6e-13 ***
groupTrt -0.23724 0.41117 -0.577 0.572
conf -0.07044 0.13725 -0.513 0.614
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for gaussian family taken to be 0.5056514)
Null deviance: 9.4175 on 19 degrees of freedom
Residual deviance: 8.5961 on 17 degrees of freedom
AIC: 47.869
Number of Fisher Scoring iterations: 2
을 얻을 얻을 수
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
conf<- c(rnorm(mean=-1, sd=1, n=10), rnorm(mean=1, sd=1, n=10))
group <- gl(2,10,20, labels=c("Ctl","Trt"))
weight <- c(ctl, trt)
lm.D9 <- lm(weight ~ group + conf)
summary(lm.D9)
으로 다음은 lm
맨에서 약간 변형 예이다
lm
은 전체 모델에 대한 요약으로 F- 통계를 가지고 있으며, glm
은 그렇지 않습니다. 다시 질문 : 어떻게 그 적합성을 설명하는 glm 모델에서 하나의 p- 값을 얻을 수 있습니까?
감사
난수 생성기 ('? set.seed')의 시드를 설정하지 않았으므로 예제가 정확하게 재현 할 수 없습니다. – Roland