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: for Red Owl: assertion is false error: mvencode


From   Nick Cox <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: for Red Owl: assertion is false error: mvencode
Date   Wed, 31 Jul 2013 11:58:27 +0100

So you are trying to look at a matrix that doesn't exist because
-doLCA- doesn't leave it behind.
I can't say why that is.

Nick
[email protected]


On 31 July 2013 11:45, O'Keeffe, Linda <[email protected]> wrote:
> Results of return list command copied and pasted:
>
> return list
>
> scalars:
>                  r(df) =  -4
>         r(EntropyRsqd) =  .5548125648846102
>          r(EntropyRaw) =  443.1214766162785
>         r(AdjustedBIC) =  66.02143919674262
>                r(caic) =  145.3516107570779
>                 r(bic) =  126.3516107570779
>                 r(aic) =  39.39868894516167
>            r(Gsquared) =  1.398688945161666
>       r(loglikelihood) =  -889.2675431454829
>           r(iteration) =  5000
>
> matrices:
>               r(llvec) :  5000 x 1
>              r(madvec) :  5000 x 1
>           r(post_prob) :  718 x 4
>                 r(rho) :  8 x 4
>               r(gamma) :  1 x 4
>
> . matrix list r(gamma) /* probability of being in each of the classes*/
>
> r(gamma)[1,4]
>        Class1     Class2     Class3     Class4
> r1  .69871284  .04822101  .19511732  .05794882
>
> . matrix list r(gammaSTD) /* standard deviations of the probability of being in each class like a standard error or confidence interval*/
>
> matrix r(gammaSTD) not found
>
> Linda
> ________________________________________
> From: [email protected] [[email protected]] on behalf of Nick Cox [[email protected]]
> Sent: 31 July 2013 11:34
> To: [email protected]
> Subject: Re: st: for Red Owl: assertion is false error: mvencode
>
> Your error message doesn't appear to be produced by -doLCA- itself. It
> appears to arise afterwards when you try to list a matrix that you
> think should exist. As official Stata is producing the error message,
> my personal rules allow comment.
>
> I suggest you
>
> 1. Show the results of -return list-. Perhaps what you want does
> exist, but you just mistyped the name.
>
> 2. Check the documentation of -doLCA- to see what results it leaves
> behind in what circumstances.
>
> 3. Always copy and paste your commands, don't retype them. Here the
> spaces introduced in
>
> matrix r (gammaSTD) not found
>
> can be ignored, but in other cases not showing exactly what Stata
> typed can confuse.
> Nick
> [email protected]
>
>
> On 31 July 2013 11:09, O'Keeffe, Linda <[email protected]> wrote:
>> I typed the following command:
>>
>> doLCA any_alcohol any_binge smoking_last_3months folic_acid_first,
>>       nclass(4)
>>           seed(100000) ///
>>           categories(2 2 2 2)
>>           criterion(0.000001)
>>           rhoprior(1.0)
>>
>> return list
>> matrix list r(gamma)
>> matrix list r(gammaSTD)
>> matrix list r(rho)
>> matrix list r(rhoSTD)
>> matrix list r(post_prob)
>>
>> The returned error was:
>>
>> matrix r (gammaSTD) not found &
>>
>> matrix r (rhoSTD) not found
>>
>> with the following message
>>>
>>> error . . . . . . . . . . . . . . . . . . . . . . . .  Return code 111
>>>         __________ not found;
>>>         no variables defined;
>>>         The variable does not exist.  You may have mistyped the
>>>         variable's name.
>>>         variables out of order;
>>>         You specified a varlist containing varname1-varname2, yet
>>>         varname1 occurs after varname2.  Reverse the order of the
>>>         variables if you did not make some other typographical error.
>>>         Remember, varname1-varname2 is taken by Stata to mean varname1,
>>>         varname2, and all the variables in dataset order in between.
>>>         Type describe to see the order of the variables in your dataset.
>>>         __________ not found in using data;
>>>         You specified a varlist with merge, but the variables on which
>>>         you wish to merge are not found in the using dataset, so the
>>>         merge is not possible.
>>>         __________ ambiguous abbreviation;
>>>         You typed an ambiguous abbreviation for a variable in your data.
>>>         The abbreviation could refer to more than one variable.  Use a
>>>         nonambiguous abbreviation, or if you intend all the variables
>>>         implied by the ambiguous abbreviation, append a `*' to the end
>>>         of the abbreviation.
>> Linda
>>
>>
>>
>> ________________________________________
>> From: [email protected] [[email protected]] on behalf of Nick Cox [[email protected]]
>> Sent: 31 July 2013 10:49
>> To: [email protected]
>> Subject: Re: st: for Red Owl: assertion is false error: mvencode
>>
>> To get good answers from people willing to advise, please specify what
>> you typed on the command line as well as the error messages you
>> receive.
>>
>> Nick
>> [email protected]
>>
>>
>> On 31 July 2013 10:09, O'Keeffe, Linda <[email protected]> wrote:
>>> Thanks very much Red Owl! That worked!
>>>
>>> One more question for you- its now running but I am getting the following errors:
>>>
>>>  matrix r (gammaSTD) not found &
>>>
>>>  matrix r (rhoSTD) not found with the following message
>>>
>>> error . . . . . . . . . . . . . . . . . . . . . . . .  Return code 111
>>>         __________ not found;
>>>         no variables defined;
>>>         The variable does not exist.  You may have mistyped the
>>>         variable's name.
>>>         variables out of order;
>>>         You specified a varlist containing varname1-varname2, yet
>>>         varname1 occurs after varname2.  Reverse the order of the
>>>         variables if you did not make some other typographical error.
>>>         Remember, varname1-varname2 is taken by Stata to mean varname1,
>>>         varname2, and all the variables in dataset order in between.
>>>         Type describe to see the order of the variables in your dataset.
>>>         __________ not found in using data;
>>>         You specified a varlist with merge, but the variables on which
>>>         you wish to merge are not found in the using dataset, so the
>>>         merge is not possible.
>>>         __________ ambiguous abbreviation;
>>>         You typed an ambiguous abbreviation for a variable in your data.
>>>         The abbreviation could refer to more than one variable.  Use a
>>>         nonambiguous abbreviation, or if you intend all the variables
>>>         implied by the ambiguous abbreviation, append a `*' to the end
>>>         of the abbreviation.
>>>
>>> Many Thanks for your help
>>> Linda
>>> ________________________________________
>>> From: [email protected] [[email protected]] on behalf of Red Owl [[email protected]]
>>> Sent: 30 July 2013 18:59
>>> To: [email protected]
>>> Subject: st: RE: assertion is false error: mvencode
>>>
>>> Linda (and other who may be interested),
>>>
>>> I believe this error occurs when you try to run the LCA Stata Plugin from The Methodology Center at Penn State (http://methodology.psu.edu/downloads/lcastata) on binary variables that are coded as 0/1.  The data must be positive integers, so you might try to add 1 to any binary variables coded as 0/1 and then attempt to rerun your analysis.
>>>
>>> Also, if you are using Stata/IC (not recommended by the plugin authors but possible with some data and problems), you need to include the option maxiter(800) in the LCA code.  That is necessary due to the maximum matrix size limitations of Stata/IC.  If you are using a higher version of Stata, you should set maxiter(5000) or higher.
>>>
>>> Red Owl
>>>
>>>
>>>>> O'Keeffe, Linda" <[email protected]<mailto:L.OKeeffe%40ucc.ie>>
>>>>>
>>>>> I am using Penn State University doLCA command. I keep getting an error after some of the code has run saying
>>>>>
>>>>> "389 contradictions in 708 observations"
>>>>>
>>>>> assertion if false
>>>>>
>>>>> r (9)
>>>>>
>>>>> r (9) error code says "   error . . . . . . . . . . . . . . . . . . . . . . . . .  Return code 9
>>>>>
>>>>>         assertion is false;
>>>>>
>>>>>         no action taken;
>>>>>
>>>>>         Return code and message from assert when the assertion is false;
>>>>>
>>>>>         see [D] assert.
>>>>>
>>>>>         Or, you were using mvencode and requested Stata change `.' to #
>>>>>
>>>>>         in the specified varlist, but # already existed in the varlist,
>>>>>
>>>>>         so Stata refused; see [D] mvencode.
>>>>>
>>>>> (end of search)
>>>>>
>>>>> I assume this is a problem with my data but I don't know what. Any assistance would be most greatly appreciated!
>>
>> *
>> *   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/

*
*   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