Announcement

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

  • Hettest in Multilevel model? Alternative homoscedasticity test for Multilevel models.

    Dear all, I'm conducting a study about the score attained in a national standardized test and its relationship with other variables.
    The data follow a hierarchical structure since the students are obviously clustered in different schools, therefore I decided to use a multilevel model.
    The command I used is: mixed score || schid:, mle.
    Now, multilevel models rely on the assumption of homoscedasticity, thus I thought to test it with a Breusch-Pagan test with the command hettest, but it says it can be done by telling me 'last estimates not found'.
    This is kind of annoying because heteroscedasticity can cause some trouble in the postestimation phase.
    So, I kindly ask how to test homoschedasticity in an alternative way.
    Thanks to those who are going to read.

    STATA OUTPUT AND COMMANDS I USED
    . mixed score || schid:, mle

    Performing EM optimization ...

    Performing gradient-based optimization:
    Iteration 0: log likelihood = -99356.128
    Iteration 1: log likelihood = -99356.128

    Computing standard errors ...

    Mixed-effects ML regression Number of obs = 20,465
    Group variable: schid Number of groups = 512
    Obs per group:
    min = 10
    avg = 40.0
    max = 103
    Wald chi2(0) = .
    Log likelihood = -99356.128 Prob > chi2 = .

    ------------------------------------------------------------------------------
    score | Coefficient Std. err. z P>|z| [95% conf. interval]
    -------------+----------------------------------------------------------------
    _cons | 188.3269 1.177546 159.93 0.000 186.0189 190.6348
    ------------------------------------------------------------------------------

    ------------------------------------------------------------------------------
    Random-effects parameters | Estimate Std. err. [95% conf. interval]
    -----------------------------+------------------------------------------------
    schid: Identity |
    var(_cons) | 685.5449 44.43029 603.767 778.3993
    -----------------------------+------------------------------------------------
    var(Residual) | 885.7819 8.868542 868.5693 903.3356
    ------------------------------------------------------------------------------
    LR test vs. linear model: chibar2(01) = 9597.74 Prob >= chibar2 = 0.0000

    .
    end of do-file

    . do "C:\Users\alfab\AppData\Local\Temp\STD2600_000 000. tmp"

    . hettest
    last estimates not found
    Last edited by Luca Tognoni; 28 Mar 2022, 07:00.

  • #2
    Luca:
    welcome to this forum.
    You might be interested in https://www.statalist.org/forums/for...ression-models
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Thank you Carlo!
      in any case I prudently used vce(robust) and in many cases the difference in SE is kind of negligibile.
      May I assume there is no serious heteroscedasticity and therefore operate as the assumption of homoscedasticity is respected?

      Comment


      • #4
        Luca:
        your approach (ie, comparing default vs -robust. standard errors to detect relevant differences) makes sense.
        Probably there's no heteroskedasticity issue; you may also want to visually inspect the residual distribution.
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment


        • #5
          Dear Carlo, thank you very much for your help.
          I attach the scatter of residuals against fitted values. In my opinion there is not strong evidence of heteroschedasticity apart from few observation on the left, especially considering the large sample size (over 15 thousands obs).
          Is it enough to operate as if they are homoscedastic?
          Click image for larger version

Name:	res vs fit.jpg
Views:	1
Size:	39.2 KB
ID:	1656672

          Comment


          • #6
            Luca;
            I share your view.
            That said, with 15,000 obs. the issue might be autocorrelation; therefore, if proved, going -robust- or -vce(cluster panelid)- (unlike -regress- they do the very same job here) can be advisable.
            Kind regards,
            Carlo
            (StataNow 18.5)

            Comment


            • #7
              Thanks Carlo, your contribution was helpful

              Comment

              Working...
              X