Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: conditional SE of y|X in glm

From   Marco Ventura <>
Subject   Re: st: conditional SE of y|X in glm
Date   Tue, 24 Apr 2012 11:29:22 +0200

Dear Nick,
thank you very much of your quick replies.
Unfortunately there is something I still do not understand. If I do
glm r ldose, fam(bin n) link (logit)
di sqrt(e(dispers))
I get two very different values 4.065 against 13.179. Which of the two is correct?

Thank you again.

Il 24/04/2012 10:57, Nick Cox ha scritto:
See -glmcorr- (SSC) for one approach here. That calculates an rmse
which appears similar, if not identical, to what you want. I like to
have such measures accessible for comparing -glm- results  with those
of other models in which rmse appears naturally. Perhaps it is a
comfort blanket, but there you go.

Note that putting a constant into a variable is usually overkill as

di sqrt(e(dispers))

does the calculation. Use a scalar or local macro if you want to store
the value.

On Tue, Apr 24, 2012 at 9:31 AM, Marco Ventura<>  wrote:

from a GLM estimate I want to retrieve the conditional standard error of y
given the covariates. If I do

gen sigma=sqrt(e(dispers))

do I always get the right thing independently of any family and link?
Should I correct it by sqrt(e(dispers)* (_N-1)/_N)?
And do you think I should instead use the Pearson residuals such as

gen sigma=sqrt(e(dispers_p))

*   For searches and help try:
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index