Bookmark and Share

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


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

Re: st: Conformability error after using -nldecompose- with survey data


From   Sergiy Radyakin <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Conformability error after using -nldecompose- with survey data
Date   Mon, 11 Nov 2013 22:17:16 -0500

Saide, the code is consistent with the problem of reading an
out-of-range element of the matrix, such as in this example:

matrix __00000F=J(6,6,99)
matrix list __00000F
mat __00000G = __00000F[1,1..6+1]

Now the interesting question is: why the matrix happened to be smaller
than expected? That is not obvious to me. The author is branching the
code all the time to accumulate many possible estimation commands with
magic constants +1, -1, or +2, and names like getba and namea don't
help much. This program is the best example of precisely where one
needs classes in Stata.

But coming back to business, you mentioned that your command is:
nldecompose, by(country):svy: logit y x1 x2 x3 x4 x5 x6
but in the trace I see very different variable names. Which means the
first posted command is probably a simplification of the actual
command. Please be exact.

As a wild guess, do you have a -noconst- option? If you do, I expect
-nldecompose- might break on it, since the saved matrix will be
smaller than usual, and I didn't find (in a few minutes that I looked
at it) handling of that situation.

As a second wild guess: check if Stata is reporting that it drops any
variables from any regressions.

As a third, try to get rid of svy for a minute, see if that matters.

You mentioned logit runs ok without nldecompose, but did you test this
by(country)?

Fourth, see if the problem is data dependent. Change specification
(add/remove variables); drop part of your sample (e.g. half), or
create a totally different dataset, but keep your own program, and run
it. If program still reports an error for a range of datasets and for
a "well-behaving" one, then this is a good reason to contact the
author.

Best, Sergiy Radyakin


On Mon, Nov 11, 2013 at 9:28 PM, Saidé Salazar <[email protected]> wrote:
> Thank you for the advice Sergiy. Below is the location of the error in
> the trace.
>
> Any help will be very appreciated!
>
>
> ------------------------------------------------------------------------------------------------------------------
> end est ---
>   - mat `getbA' = e(b)
>   = mat __00000F = e(b)
>   - local dim1 = wordcount("`indvar'")
>   = local dim1 = wordcount("s_size_1 s_size_3 S_SECTOR_2 S_SECTOR_3
> TL_TAM_LOC_2 TL_TAM_LOC_3")
>   - local dim2 = colsof(`getbA')
>   = local dim2 = colsof(__00000F)
>   - if ("`regcmd'"!="zip" & "`regcmd'"!="zinb" & "`regcmd'"!="ologit"
> & "`regcmd'"!="oprobit") {
>   = if ("logit"!="zip" & "logit"!="zinb" & "logit"!="ologit" &
> "logit"!="oprobit") {
>   - mat `betaA' = `getbA'[1,1..`dim1'+1]
>   = mat __00000G = __00000F[1,1..6+1]
> conformability error
>     local k1 = `dim1'+1
>     }
>   ------------------------------------------------------------------------------------------
> end nldecompose.nld_decomposition ---
>   if "`bs_step'" == "" {
>   nld_setreturns
>   ereturn clear
>   sreturn clear
>   }
>   }
> --------------------------------------------------------------------------------------------------------------
> end nldecompose ---
> r(503);
>
> On Mon, Nov 11, 2013 at 6:23 PM, Sergiy Radyakin <[email protected]> wrote:
>> Saide, insert
>> set trace on
>> before calling nldecompose... and show us what is the location of the
>> error in the trace.
>>
>> In general no command (official or user written) should report this
>> error. It is evidence of unforeseen situation, for example of rare
>> combination of inputs. -nldecompose- is doing a lot of matrix
>> operations, see source:
>> http://www.stata-journal.com/software/sj8-4/st0152/nldecompose.ado
>>
>> Best, Sergiy
>>
>>
>>
>> On Mon, Nov 11, 2013 at 6:34 PM, Saidé Salazar <[email protected]> wrote:
>>> Dear Statalist members
>>>
>>> I am using -nldecompose- after a logistic regression with survey data,
>>> and I am getting a "conformability error". Can anyone help me to
>>> understand why is this happening?
>>>
>>> Here is my command line:
>>>
>>> . nldecompose, by(country):svy: logit y x1 x2 x3 x4 x5 x6
>>> conformability error
>>> r(503);
>>>
>>> The -logit- runs okay without the -nldecompose- option.
>>>
>>> Thank you very much!
>>>
>>> Saide
>>> *
>>> *   For searches and help try:
>>> *   http://www.stata.com/help.cgi?search
>>> *   http://www.stata.com/support/faqs/resources/statalist-faq/
>>> *   http://www.ats.ucla.edu/stat/stata/
>>
>> *
>> *   For searches and help try:
>> *   http://www.stata.com/help.cgi?search
>> *   http://www.stata.com/support/faqs/resources/statalist-faq/
>> *   http://www.ats.ucla.edu/stat/stata/
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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