Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to troubleshoot the error 900 or?

    Hello,
    I have the following problem on STATA 12:
    in the room to add more variables
    room for 5564 additional variables and additional width of 44512 required

    And:

    no room to add more variables
    Up to 5,000 variables are currently allowed, although you could reset the
    maximum using set maxvar; see help memory.
    r(900);

    What needs to be done to solve this problem?




  • #2
    Rafaella:
    it's likely that the limit of the Stata flavour you're running has been reached:

    Code:
    search for r(900)                                                                                                                                                     (manual:  [R] search)
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    Search of official help files, FAQs, Examples, SJs, and STBs
    
    [P]     error . . . . . . . . . . . . . . . . . . . . . . . .  Return code 900
            no room to add more variables;
            Stata just attempted to exceed the maximum number of variables
            allowed.  If you are using Stata/SE or Stata/MP, you can reset
            this maximum number; see [D] memory.  For Stata/IC, the maximum
            number is fixed at 2,047.
    Type -help limits- to check for this.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      My initial response to the second quoted error message would be to type the help memory command as Stata advises, and follow its advice for using the set maxvar command to increase the number of variables allowed.

      However, you haven't shared with us enough information about what you are attempting to accomplish for the readers to be able to determine if Stata's attempt to add 5,564 variables is itself a mistake. Perhaps the command that generated the error message was incorrect, or could be better accomplished some other way.

      We can better help you if we know what commands you have tried and what Stata told you to indicate that there was a problem. Please review the Statalist FAQ linked to from the top of the page, especially sections 9-12 on how to best pose your question. It's particularly helpful to copy commands and output from your Stata log window and paste them into your Statalist post using CODE delimiters, as described in section 12 of the FAQ.

      ADDED IN SUBSEQUENT EDIT:

      After writing the above, I looked at your other posts and found more information. I understand that you are instructing Stata to create 5,564 variables, one for each distinct locality. Without understanding what your objective is (none of the posts describes your data in any detail) I would suggest that perhaps you are not choosing to organize your data correctly. What you are describing is in Stata called having a "wide" organization. This contrasts with a "long" organization having each locality in a separate observation (or set of observations, if as I suspect each locality has repeated observations over time). This is based on the terminology of the reshape command, which transforms data between the two formats; see help reshape for details.

      The experienced users here generally agree that, with few exceptions, Stata makes it much more straightforward to accomplish complex analyses using a long organization rather than wide organization of the same data. That leads me to question whether indeed what you are attempting to do is really the best approach to whatever problem you are trying to solve.

      As I wrote above, if you share more information about your data and your goals for the analysis, the readers can perhaps suggest other approaches. Otherwise, we risk giving you "the right answer to the wrong question", leading to further problems later.
      Last edited by William Lisowski; 27 Aug 2015, 07:31.

      Comment


      • #4
        I'm calculating some indexes of spatially weighted productive specialization with database 5564 cities and 21 different productive sectors.
        Being i to the cities and j to the productive sectors.
        The commands I am using are:
        To calculate the indexes (without the spatial weighting) I used:
        gen Ej1=(J)/total_row
        gen Ej2=(total_colJ[5565])/(total_colTR[5565])
        gen QLj=Ej1/Ej2
        Generatingthe indicator QLj withoutthespatialweighting.
        To create this matrix (S) based on the file "municipios_2010_rainha.gal" we do:
        spwmatrix gal using municipios_2010_rainha.gal, wname(S) rowstand
        Generatinga "vector of ones" (I)andcalculatingtheirtransposed(V):
        gene const=1
        mkmat const, matrix(I)
        matrix V=I'
        matrix list V
        Multiplyingthe matrixVand the matrix ofweight (S):
        matrix Z=V*S
        matrix list Z
        GeneratingtheJ1variable: J1[i]=(1/5564)*QLj
        gen J1=(1/5564)*QLj
        list J1

        Turningthe matrix Zinvariable tobe able to do after multiplication:
        svmat double Z ***** In this stepwhich is givingthefollowing error:
        no room to add more variables
        room for 5564 additional variables and additional width of 44512 required
        r(900); *************************** Because as has been explained in the Forum, I can't do the multiplication of a variable (J1) and the matrix (Z).
        Is necessary to transform the matrix Z in variable to make the next step, which is to generate KKK1.
        Generating new variable KKK1 where KKK1 [i] = J1 [i] * Z [1, i].
        gen KKK1= J1*Z
        list KKK1

        This is my process until the moment.

        What needs to be done to solve this problem?

        Comment

        Working...
        X