Announcement

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

  • report var(residual) / melogit vs. xtmixed ?

    l am working about cross-classified multilevel model

    dependent variable : immigration y/n (binary, immigration : 1, none : 0), level1 : personal variable, level2 : move-out reigon(varlist : depid_), level2: move-in region(varlist : arrid_)



    meqrlogit immigration(binary) || all : R.depid_(move-out region) || arrid_(move-in region):, var


    i use "var" option. but, didn't report the result of variance(residual). what's the problem?



    can i use xtmixed model instead of melogit model in binary dependent variable?

  • #2
    In a logistic model, the residual variance is always pi2/3.

    Comment


    • #3
      Also, xtmixed is the old name for mixed. Both fit hierarchical linear models. If you fit one to binary data, that's like fitting a fancier linear probability model. Some people will get nervous if you do that, because we do have logistic regression. LPMs actually work fairly well, though.
      Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

      When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

      Comment


      • #4
        Professor Schechter, I am working on a study using "meologit" in Stata. But when I type "estat ICC" after "meologit dv || Country:", it prompts "requested action not valid after most recent estimation command". I tried to compute ICC manually, but I don't know how to compute the within-group variation, since the code "meologit dv || Country:" only returns the between-group variation. I also tried the "meologit dv || Country:, var", but it turns out "option var not allowed" . So what should I do? Is the residual variance "pi2/3" the within-group variance in my situation?

        Comment


        • #5
          Well, yes, the within-group variance in an ologit model is always pi2/3. But what Stata is trying to tell you is that the ICC is not definable after the model you have run. I can't think of any reason this would be true if your code is truly -meologit dv || Country:"-, so I'm wondering if you are presenting here a simplified or edited version of your actual -meologit- command. In particular, the ICC is not defined in models with crossed-random effects or non-independent covariance structure.

          So please post back showing the exact -meologit- code you ran, the output that Stata gave you from that command, and the -estat icc- command and Stata's response to that. Show everything, exactly, without any editing. Place it between code delimiters for legibility.

          Added: -meologit- does not have a -var- option. It reports the variance components as variances, not standard deviations in any case (at least in recent versions of Stata).

          Comment


          • #6
            Thanks for your reply, and here are the codes and output (I don't understand the "code delimiters" you said , instead I bold the code). Looking forward to your reply, thanks.

            . meologit dv || Country:

            Fitting fixed-effects model:

            Iteration 0: log likelihood = -16279.597
            Iteration 1: log likelihood = -16279.597

            Refining starting values:

            Grid node 0: log likelihood = -14921.29

            Fitting full model:

            Iteration 0: log likelihood = -14921.29
            Iteration 1: log likelihood = -14826.973
            Iteration 2: log likelihood = -14826.52
            Iteration 3: log likelihood = -14826.516
            Iteration 4: log likelihood = -14826.516

            Mixed-effects ologit regression Number of obs = 11,521
            Group variable: Country Number of groups = 74

            Obs per group:
            min = 12
            avg = 155.7
            max = 1,645

            Integration method: mvaghermite Integration pts. = 7

            chi2() = .
            Log likelihood = -14826.516 Prob > chi2 = .
            ------------------------------------------------------------------------------
            dv | Coef. Std. Err. z P>|z| [95% Conf. Interval]
            -------------+----------------------------------------------------------------
            /cut1 | .0753714 .1448334 -.2084968 .3592396
            /cut2 | 1.38835 .1454075 1.103356 1.673343
            /cut3 | 1.870417 .1459492 1.584361 2.156472
            /cut4 | 2.472127 .1470642 2.183886 2.760367
            /cut5 | 3.296253 .1499327 3.00239 3.590115
            /cut6 | 3.964193 .1542821 3.661805 4.26658
            -------------+----------------------------------------------------------------
            Country |
            var(_cons)| 1.47951 .265326 1.041043 2.10265
            ------------------------------------------------------------------------------
            LR test vs. ologit model: chibar2(01) = 2906.16 Prob >= chibar2 = 0.0000

            . estat icc
            requested action not valid after most recent estimation command
            r(321);

            Comment


            • #7
              I'm stumped. The regression results look plausible, and the model has no crossed-effects or exotic covariance structure. The estimation converged. But for some reason, you cannot get -estat icc- to run. I might ask you to post an example data set that reproduces your problem, but I suspect that would not resolve the issue. I have checked on my own installation that -estat icc- runs following a model similar to yours. One question: what version of Stata are you running? I don't know, but it may be that some earlier versions do not allow -estat icc- after -meologit-. I suggest you type -help estat postestimation- and see if that page contains a link to estat icc. If it doesn't, that would suggest your version of Stata doesn't support this calculation.

              If there is a link to estat icc there, then you shouldn't be encountering this difficulty. Then I would try running -update all- to make sure that your Stata is the latest possible update of your version (and that all the components are consistent with each other.) If that doesn't solve the problem, I would refer it to technical support.

              Comment


              • #8
                -estat icc- support following -meologit- was added in the 16oct2019 update for Stata 16:

                Code:
                . help whatsnew16
                
                -------- update 16oct2019 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                ...
                     3. estat icc is now supported after meoprobit, meologit, and meglm with the ordinal family and probit or logit links.
                ...

                Comment


                • #9
                  Thanks Professor Schechter and Leonardo. I used Stata 15, that explained why the "estat icc" did not work after "meologit". After updating Stata, finally it works.
                  Besides, I used the pi2/3 (3.29) to compute the ICC, the two results are almost the same. Thanks a lot, Professor Schechter.

                  Comment

                  Working...
                  X