Announcement

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

  • Maximum matsize is too small

    Hello,

    My sample includes observations for some 170 companies for 16 years, where i have 4 explanatory vars and 10 dummies. I use 4 fixed effect and have 250000 observations.I have not accidentally treated a continuous variable as a categorical and have not included an interaction that has lots of missing cells.

    I run a regression and meet with stata complaint as;

    matsize too small
    You have attempted to create a matrix with too many rows or columns or
    attempted to fit a model with too many variables. You need to increase
    matsize; it is currently 11000. Use set matsize; see help matsize.

    ... ...


    As you might know, my matsize is already max and, to my best, there is no way to increase it further. Now i am considering to drop some of the companies to deal with it. But the est scenario would be continue without dropping any company, so it would be rewarding if you show any way that i continue without doing changes in my database. If there is no way to do so, then, is there any way (command, formula) that i may guess how may of the companies i need to drop to satisfy matsize requirement.


    Thank you for your attention.

    Regards,
    Dias



  • #2
    Statalist participants can better help you if we know what commands you have tried that create the error message you provided. Please review the Statalist FAQ linked to from the top of the page, as well as from the Advice on Posting link on the page you used to create your post. See especially sections 9-12 on how to best pose your question. It's particularly helpful to copy commands and output from your Stata Results window and paste them into your Statalist post using CODE delimiters, as described in section 12 of the FAQ. For panel data, which is what you appear to be using, be sure to include the xtset command so we can understand how you come to have 250,000 observations from 170 companies: an average of 1400 observations per company, around 80 per year per company.

    You might consider starting with a selection of, say, 20 of your companies and see what the results are. Perhaps the results will suggest a specification problem that is generating too many dummy variables on the fly.

    In writing the previous paragraph, I realize I was taking your "10 dummies" to mean 10 dummy variables after factor variables are expanded. But you probably mean 10 variables with dummies created by Stata using factor variable (i.x) notation. If so, the results of the codebook command for those 10 variables might be instructive.

    Comment


    • #3
      Originally posted by William Lisowski View Post
      Statalist participants can better help you if we know what commands you have tried that create the error message you provided. Please review the Statalist FAQ linked to from the top of the page, as well as from the Advice on Posting link on the page you used to create your post. See especially sections 9-12 on how to best pose your question. It's particularly helpful to copy commands and output from your Stata Results window and paste them into your Statalist post using CODE delimiters, as described in section 12 of the FAQ. For panel data, which is what you appear to be using, be sure to include the xtset command so we can understand how you come to have 250,000 observations from 170 companies: an average of 1400 observations per company, around 80 per year per company.

      You might consider starting with a selection of, say, 20 of your companies and see what the results are. Perhaps the results will suggest a specification problem that is generating too many dummy variables on the fly.

      In writing the previous paragraph, I realize I was taking your "10 dummies" to mean 10 dummy variables after factor variables are expanded. But you probably mean 10 variables with dummies created by Stata using factor variable (i.x) notation. If so, the results of the codebook command for those 10 variables might be instructive.
      Hi William, I have the same problem, trying to test for heterosked in a random effects panel. Command is xtgls netreturn sin religiositymean sinreligiositymean beta lmarketcap lpb bev lgdp spread inflationrate open law year1 year2 year3 year4 year5 year6 year7 year8 year9 year10 i.country_c, igls panels(heteroskedastic). Xtset company time is 11261, 120 respectively.

      Any help would be much app, I have run set matsize 200 about 25 times but still too small. I'm getting the error: matsize too small - should be at least 11217. I understand the max matsize is 11000 so am unsure how to get round the excess of 217.
      Last edited by Krissy Philips; 20 Feb 2017, 10:01.

      Comment


      • #4
        Also on the back of that, if I set the size to ,permanently by accident, how do I undo this? Thanks

        Comment


        • #5
          I am not sure of this, but I think that your matrix is blowing up because of the -panels(heteroskedastic)- specification. I think that causes -xtgls- to try to create a VCE matrix with dimensions equal to the number of panels (which exceeds 11,000). If I am right about this, you won't be able to do this in Stata. The only way to get around the maximum allowed matrix size of 11,000 is to work in Mata, but you can't do that from within the -xtgls- command. So unless you are prepared to write your own -xtgls- estimator in Mata, you will have to abandon the heteroskedastic specification, or restrict your data to a smaller sample.

          Comment


          • #6
            Thanks Clyde. Do you think that the normal Breusch-Pagen/Cook-Weinberg test for heteroscedasticity test will suffice for this panel in that case?

            Comment


            • #7
              I don't know. I hardly ever use that test and I don't know how far it generalizes. Perhaps somebody else can advise.

              Comment


              • #8
                A , permanently can be overridden by the next , permanently.

                Comment


                • #9
                  I am also running heteroskedasticity test for random effect panel model and I find the following problem
                  : matsize too small to create a [1047,1] matrix
                  Please help.

                  Comment


                  • #10
                    -help set matsize-

                    Comment

                    Working...
                    X