I am encountering an error message using the KHB command with Stata 18.0 for Windows, similar to the one posted below in the earlier Statalist.
The current error message is:
khb(): 3301 subscript invalid
<istmt>: - function returned error
The error below was apparently resolved upon restarting Stata, however the current message is not. Also, the lkhb.mata file reads as described in the answer below.
I appreciate advice regarding the solution to this issue.
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 c:\ado\plus\k\khb.ado *! version 2.7 November 16, 2011 @ 16:41:49 UK *! Decomposing total effects using the KHB method *! Support: [email protected] 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. Best Daniel * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/
The current error message is:
khb(): 3301 subscript invalid
<istmt>: - function returned error
The error below was apparently resolved upon restarting Stata, however the current message is not. Also, the lkhb.mata file reads as described in the answer below.
I appreciate advice regarding the solution to this issue.
From | daniel klein <[email protected]> |
To | [email protected] |
Subject | st: <istmt>: - function returned error ,in KHB Command |
Date | Tue, 27 Dec 2011 00:38:08 +0100 |
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 c:\ado\plus\k\khb.ado *! version 2.7 November 16, 2011 @ 16:41:49 UK *! Decomposing total effects using the KHB method *! Support: [email protected] 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. Best Daniel * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/
Comment