0
$\begingroup$

I got the SE of glm(y=x) by the following program. But I couldn't get the same SE as vcov() and sigma() by the following program glm(y ~ x, family=poisson(log)). I can't understand the difference of SE from vcov() and sigma(). And it has another way without covariance matrix? Please give me some advice.

glm(y~x)

x<-c(2,2,3,3,3,4,4)
y<-c(15,9,13,10,7,11,5)
model <- glm(y~x)
(result<-summary(model))
#            Estimate Std. Error z value Pr(>|z|)    
#(Intercept)   16.000      5.084   3.147   0.0255 *
#x             -2.000      1.643  -1.217   0.2779    
(SEvcov<-diag(sqrt(vcov(model))))#parameter SE
#(Intercept)           x 
#   5.083587    1.643168  
(SEsigma <- 
sqrt(diag(sigma(model)^2*result$cov.unscaled)))#parameter SE
#(Intercept)           x 
#   5.083587    1.643168 

glm(y~x, family=poisson)

x<-c(2,2,3,3,3,4,4)
y<-c(15,9,13,10,7,11,5)
model<-glm(y~x,family=poisson(link=log))
(result<-summary(model))
#            Estimate Std. Error z value Pr(>|z|)    
#(Intercept)   2.8940     0.4749   6.094  1.1e-09 ***
#x            -0.2010     0.1593  -1.262    0.207    
(SEvcov<-diag(sqrt(vcov(model))))#parameter SE
#(Intercept)           x 
#  0.4748514   0.1592545 
(SEsigma <- 
sqrt(diag(sigma(model)^2*result$cov.unscaled)))#parameter SE
#(Intercept)           x 
#  0.5050869   0.1693948
$\endgroup$
2
  • $\begingroup$ Why do you reference cov.unscaled? Have you noticed that the two outputs are directly proportional? $\endgroup$
    – whuber
    Dec 26, 2019 at 15:03
  • $\begingroup$ Thanks for your comment. hmm.., I can't get the SE values like glm(y~x)? I confuse. $\endgroup$
    – 51sep
    Dec 27, 2019 at 14:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.