Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Help: how to manually calculate the standard error of coefficient estimates in logit regression

From   Maarten buis <>
To   Enya He <>
Subject   Re: st: Help: how to manually calculate the standard error of coefficient estimates in logit regression
Date   Wed, 16 May 2007 08:05:48 +0100 (BST)

--- Enya He <> wrote:
> I am doing a logit regression as follows: 
> Y = Function (X1-X5, X1*X5), where X1-X4 (all continuous variables),
> X5 (dummy variable), X1*X4 (interaction term). 
> According to a paper in Journal of Corporate Finance, the marginal
> effects reported in Stata is inaccurate when an interaction term
> involving a dummy variable, which is my situation. I found a way to
> manually derive the marginal effects (the derivative of y w.r.t.
> X1-X4, X5, and X1*X4).  However, to test whether these marginal
> effects are significant, I also need to manually calculate the
> standard errors.  

Comparing logit coefficients across groups is tricky business, but
there are many user written routines that tackle this issue. Have you
looked at:

the -inteff- command by Edward C. Norton, Hua Wang, and Chunrong Ai (if
you are using Stata 9 you can download a newer and quicker version from
Edward Norton's website:, 

the -oglm- command by Richard Williams. You can install that using -ssc
install oglm-. See his excellent working paper "Using Heterogeneous
Choice Models To Compare Logit and Probit Coefficients Across Groups"
on how this program helps you with your issue:

If you want to do this your own way, the easiest way to do that is to
use the -nlcom- command. The marginal effect are typically a nonlinear
combination of the estimated logit parameters, and -nlcom- will give
you those and the standard errors.

> I do not quite understand "second derivatives of the likelihood
> function with respect to the parameters".  How can I take derivatives
> w.r.t. some constants (i.e. parameters)?  

The likelihood function tells you how likely it is to find the data
given the parameters. Within the likelihood function the data is
treated as fixed, and the parameters as variable. You (Stata or any
other program that maximizes the likelihood) chooses those parameters
that maximize the likelihood.

Hope this helps,

Ps I have cc-ed this answer to the statalist as others may have
followed this thread and might want to know how it ends. 

Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

Yahoo! Messenger - with free PC-PC calling and photo sharing.
*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index