Announcement

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

  • An alternative to likelihood-ratio heteroskedasticity test for panel data

    Hi, I am trying to perform the standard likelihood ratio heteroskedasticity test for panel data:

    xtgls dep var independent var, igls panels(heteroskedastic)
    estimates store hetero
    xtgls dep var independent var, igls
    local df = e(N_g) - 1
    lrtest hetero . , df(`df')

    But I cant execute it due to maximum matsize limit.

    Does anyone know of viable alternative to this heteroskedasticity test or is my only option to switch to R or other stats program?

    Thanks in advance for any advice!


    Last edited by Jozef Patrnciak; 25 May 2018, 06:19.

  • #2
    You do know that mat size can be increased, right? Assuming you have done that, at what point does the error occur? I would be surprised if you made it all the way to the lrtest command and then had problems. Showing commands and output could help, or at least say what the actual error message was.
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    StataNow Version: 19.5 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://www3.nd.edu/~rwilliam

    Comment


    • #3
      Yes I know it can be increased by set matsize #, but unfortunately I only have stata IC so the max is 800 and I need at least 3900, and I am just a poor student so I cant really afford an upgrade

      Comment


      • #4
        You might see if your school has public labs where a more powerful version of Stata is available.

        You still haven’t said when the error occurs, But perhaps you could get it to work if you used a random sub sample of your data.
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        StataNow Version: 19.5 MP (2 processor)

        EMAIL: [email protected]
        WWW: https://www3.nd.edu/~rwilliam

        Comment


        • #5
          The error occurs when I try to run the command "matsize too small - should be at least 3900 r(908);", the university pc labs have also only IC version.

          I was thinking about creating random sub-samples too, but that would decrease the power of the test and also then I guess I would need to come up with some sort of test statistics to test whether all sub-sample results are jointly significant. I guess in that case I might as well just carry out the lr test in R, but if there is some other option - like an alternative test that does not require large matsize, which would let me to do everything in stata I would prefer that.

          Comment


          • #6
            That is not the command, that is the error message you received. What command produced that error?
            -------------------------------------------
            Richard Williams, Notre Dame Dept of Sociology
            StataNow Version: 19.5 MP (2 processor)

            EMAIL: [email protected]
            WWW: https://www3.nd.edu/~rwilliam

            Comment


            • #7
              I meant the command xtgls dep var independent var, igls panels(heteroskedastic), that I mentioned in my opening post. Sorry I should have been more specific.

              Comment


              • #8
                Does it run without the hetero option? Or can you just not estimate a model no matter what you do?

                I don't know what your sample size is, but I often use a random subsample if that is the only way to make things work.
                -------------------------------------------
                Richard Williams, Notre Dame Dept of Sociology
                StataNow Version: 19.5 MP (2 processor)

                EMAIL: [email protected]
                WWW: https://www3.nd.edu/~rwilliam

                Comment


                • #9
                  No, it does not run even without it. I think that xtgls it requires 1 matsize per a group because I already encounter similar problem when I had cca 400 groups but the default matsize was only 200 so I had to change it, and the error message then and also now ask for the matsize equal to the number of groups.

                  I have 3900 firms with average 30 observations per group. That is not small but at the same time I have to include a lot of independent variables including industry fixed effects. The expected effects for main variables are quite small around 0.01, so I would like to have as many observation as possible.

                  By the way when you use a sub-sample you just draw an one random sub-sample, run the test and make an inference from that test about whole sample, or do you run repeated sub-samples and then do some kind of meta analysis of the test results from all the sub-samples?

                  Comment


                  • #10
                    Is every single analysis that you want to run plagued by this matsize problem? Or is it just the analyses needed for this test that is causing you grief?

                    If the former, I would just draw a 10% random subsample of firms and do all my analysis with it. Even if you could somehow combine results, it will be a nightmare if you have to keep combining results for every analysis you do.

                    I don't know if there is a way to combine results. Maybe there is. But it wouldn't be necessary with a more powerful version of Stata. I would just run it on the subsample and report the results, noting that it was impossible to run the analysis on the full sample.

                    If you are having trouble running anything and you absolutely positively have to analyze the full sample, I would beg somebody to buy a more powerful version of Stata. Or maybe request an evaluation copy: https://www.stata.com/customer-service/evaluate-stata/

                    Personally, though, I've never been reluctant to use subsamples when the full sample was too monstrous. I don't know what your needs and goals are though.
                    -------------------------------------------
                    Richard Williams, Notre Dame Dept of Sociology
                    StataNow Version: 19.5 MP (2 processor)

                    EMAIL: [email protected]
                    WWW: https://www3.nd.edu/~rwilliam

                    Comment


                    • #11
                      Thanks for your advice. I guess I will try to just make a random sub-sample, this is the only case I had this problem, and its only with the xtgls

                      Comment

                      Working...
                      X