Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

Re: st: <istmt>: - function returned error ,in KHB Command

From   "Rauscher, Garth" <>
Subject   Re: st: <istmt>: - function returned error ,in KHB Command
Date   Tue, 27 Dec 2011 12:41:56 -0600

Thank you for the response, Daniel. I am using Stata 11 and everything
checks out the way you said it should. This morning I received a slightly
different error message using my owb dataset, that I thought might provide
abother clue:

. khb logit all45 income || oncampus academic, c(agec agecsqr) su
                   khb():  3301  subscript invalid
                 <istmt>:     -  function returned error


Date: Tue, 27 Dec 2011 00:38:08 +0100
From: daniel klein <>
Subject: st: <istmt>: - function returned error ,in KHB Command

Are you sure you have the latest version of -khb- installed? I cannot
replicate the error using Stata 12 and -khb- (installed from SSC)

. which khb
*! version 2.7 November 16, 2011 @ 16:41:49 UK
*! Decomposing total effects using the KHB method
*! Support:

It seems the problem is not in the ado-file but in lkhb.mata and its
compiled version. So make sure you have the correct Mata files
installed, too. There is no "*! version" comment in the file, so type

findfile lkhb.mata
doedit "`r(fn)'"

The file should read

// Calculate correlation metric from coefficient vectors
// version 0.3 Implements new standard error
// version 0.4 Remove bug in concomitant function
// version 0.5 Set SE to missing for option SE

        // The KHB-Method
        // -------------

        void khb(
                string rowvector SURxnames,
                string rowvector FULLznames,
                string rowvector FULLxnames,
                string scalar Method

The error message you showed us, suggests that there is one line
missing in the definitions.



Date: Mon, 26 Dec 2011 15:12:58 -0600
From: "Rauscher, Garth" <>
Subject: st: <istmt>: -  function returned error ,in KHB Command

I am running the user-written KHB command to conduct a mediation analysis
and am receiving an error I have never received before. I reinstalled KHB
and checked that my Stata was all up to date and the message still
appears. Here is an example using the auto dataset.

. sysuse auto
(1978 Automobile Data)

. khb logit foreign  mpg  || weight,  su
                   khb():  3001  expected 3 arguments but received 4
                 <istmt>:     -  function returned error

Thanks for reading this.

Garth H Rauscher
Associate Professor of Epidemiology
UIC School of Public health

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index