On Sep 16, 2008, at 6:01 AM, Hans Olav Melberg wrote:
When using the following:
logit c6 $x6 [pweight=w2all], or
mfx compute, at(gateway=0)
I get:
Marginal effects after logit
y = Pr(c6) (predict)
= .00067379
etc
How do I find standard error of the predicted value?
The predicted value (y = 0.00067) is calculated using weights as well
as at the mean of the variables, except for one variable which is 0.
I found some commands that might be useful, but they did not
accept weights.
The code below is shorter than the previous version. Hans didn't say
he had survey data. If not, then he can skip -svyset- and the -svy-
prefixes and just add [pweight] statements to the -mean- and -logit-
commands. He asked for the standard error of prediction, but -
adjust- creates standard errors for the linear predictor and
translate the resulting CI to the probability scale. I think this is
the proper approach. My mail program adds invisible spaces to the
text; be sure to zap gremlins before running this code.