Announcement

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

  • LRT for multivariate regression?

    Hi All

    from what i understand, multi-variate regression is simply just two regressions in one for ease of presentation. If i calculated a likelihood ratio test for both models (before doing them in a multi-variate form), do they still apply to the multi-variate one since it is a matter of presentation? If not, how do I do a LRT for multivariate regression models, since I tried and they give me an error. Command I tried: lrtest m1 m2

  • #2
    I wouldn’t describe a multivariate regression as being like two univariate regressions in one, but from a lay perspective, I think that explanation is not too far wrong. You are trying to control for two or more confounders simultaneously in a multi variate regression.

    Now, about likelihood ratio tests: these are used to compare two nested​​​​​ models. If your model 1 has a subset of the predictors in model 2, they’re nested. For example, say I had foot width as the dependent variable, and I have foot length and sex as two independent variables. If I fit model 1 with just foot length and model 2 with foot length and sex, model 1 is nested in model 2. If I fit model 3 with just sex, model 3 and 1 aren’t nested.

    you didn’t state what error you got, but from your post, it sounds like you’re trying to compare non-nested models.
    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


    • #3
      Dear Weiwen

      Thank you so much
      I did two multi-variate regressions and stored the models as m5 and m6. They are nested because one of them has one less explanatory variable.
      I get the following error when i try to use command lrtest even though it worked for the normal regression. Can i just use the values that came out from the regressions?. Also, can you please tell me if the LRT chisquare is 46 and pvalue is 0.000 does that mean the second (bigger model) is better?


      . lrtest m5 m6
      model m5 does not contain scalar e(ll)
      r(498);

      Code:
      Code:
      * Example generated by -dataex-. For more info, type help dataex
      clear
      input byte(CV1 CV2 SS1 SS2 COM1 COM2 APM1 APM2 ER1 ER2 PAYSATISFIED GSATISFIED GMOTIVATED ProsocialImpact)
      4 4 4 4 4 4 4 4 4 2 4 5 4 4
      3 5 5 5 5 4 5 5 3 2 4 3 3 2
      3 5 5 5 5 3 4 5 5 3 1 1 3 2
      2 2 2 1 2 5 4 4 5 5 1 1 1 5
      3 4 3 2 3 3 4 4 5 4 2 3 3 2
      2 1 1 5 5 5 2 5 5 2 2 2 4 2
      3 3 4 2 4 5 4 4 4 4 1 1 2 2
      3 5 4 4 4 4 3 5 4 4 1 2 2 3
      5 3 2 4 4 2 2 4 5 4 2 3 2 4
      1 3 4 2 2 4 3 4 5 5 1 1 1 3
      5 5 5 5 5 5 4 5 3 5 3 3 4 4
      1 5 4 1 1 1 5 1 5 4 3 3 3 2
      3 5 4 5 4 3 5 4 4 4 4 3 2 3
      5 5 5 5 4 4 4 3 2 5 4 3 4 4
      2 5 3 4 4 2 4 2 5 5 1 4 4 4
      4 3 5 5 5 5 2 4 4 3 2 2 3 4
      2 5 4 3 4 2 4 1 4 2 2 2 2 4
      2 4 2 5 4 5 5 4 4 2 1 2 2 5
      5 4 4 5 4 4 3 4 5 5 4 4 4 5
      5 5 4 5 5 4 3 4 4 5 4 5 4 5
      4 4 2 2 3 5 2 3 4 4 2 2 2 2
      3 4 3 3 2 4 2 2 4 2 2 2 2 4
      5 5 5 3 4 4 4 5 5 5 2 5 5 5
      1 5 5 4 5 5 5 5 4 4 3 3 3 3
      4 2 2 4 4 4 4 4 5 2 1 1 2 3
      1 4 3 5 4 4 4 4 4 4 4 2 3 4
      2 5 4 5 5 3 2 2 3 3 2 2 2 5
      4 4 4 4 4 4 3 3 4 5 4 4 4 4
      3 5 4 5 5 5 4 4 5 5 1 2 3 4
      2 4 3 5 3 4 3 4 4 3 1 3 3 3
      4 3 4 4 4 3 3 3 4 3 2 4 4 4
      4 5 4 5 4 4 4 5 4 2 1 4 4 4
      5 5 5 5 5 4 5 5 4 4 2 4 4 4
      5 5 1 1 1 5 5 5 5 5 1 1 1 1
      4 3 3 3 4 2 4 4 4 3 4 4 3 4
      2 5 5 5 5 2 4 5 4 2 2 4 4 5
      4 4 3 5 5 3 3 4 4 4 3 4 3 4
      4 2 4 5 5 5 2 3 3 3 4 2 2 2
      5 3 4 5 5 5 4 5 2 2 4 2 4 5
      4 2 4 5 4 4 4 5 5 2 2 2 2 2
      4 4 5 5 5 5 4 3 5 5 2 4 3 4
      2 4 5 5 5 4 4 3 4 2 3 4 4 4
      4 5 5 5 5 5 3 3 4 5 4 4 4 4
      5 5 5 5 5 5 4 5 4 2 3 5 4 5
      5 5 5 5 3 3 4 4 2 4 4 4 3 4
      5 5 1 2 5 2 5 5 5 5 5 5 5 5
      1 5 3 3 2 4 1 4 5 2 3 2 2 2
      2 5 5 4 2 2 2 5 4 4 2 2 2 2
      4 4 4 5 5 4 2 2 4 3 3 4 4 5
      5 5 5 5 4 5 5 5 5 5 5 5 5 5
      4 3 3 3 4 4 4 4 5 5 2 3 3 2
      4 5 4 2 4 4 4 4 4 2 1 1 4 4
      3 5 5 4 2 4 3 4 5 4 2 4 4 4
      3 5 4 3 5 4 4 4 5 5 1 4 4 4
      2 3 3 5 5 5 4 3 3 5 1 2 3 3
      2 1 3 2 4 2 4 5 4 4 1 2 4 5
      4 5 4 2 4 3 4 4 2 3 3 4 4 4
      2 5 4 5 5 2 2 4 4 4 1 2 2 2
      5 4 5 5 5 5 4 4 5 5 5 5 5 5
      5 5 5 5 5 5 4 5 4 5 5 5 5 5
      4 3 3 1 4 3 3 4 3 4 2 4 3 4
      5 4 4 4 4 3 3 3 4 2 2 3 3 2
      4 5 4 1 4 1 2 4 3 5 2 4 2 5
      4 5 5 5 5 5 4 5 5 5 2 3 4 4
      4 5 5 4 5 5 4 4 5 5 3 4 4 4
      3 4 4 4 4 4 4 5 5 5 2 2 3 3
      4 5 4 5 4 4 4 4 4 5 3 4 3 4
      2 4 4 4 4 4 3 4 4 4 4 4 4 4
      4 5 4 4 5 5 3 4 5 5 2 4 2 4
      5 5 5 4 5 3 1 5 4 5 2 3 2 5
      4 4 3 4 4 4 4 3 3 4 4 3 4 4
      2 2 3 5 5 5 2 3 4 4 4 5 4 5
      4 4 4 4 4 4 4 3 4 4 4 4 4 4
      4 5 2 4 4 4 5 5 4 4 2 4 4 4
      5 5 5 5 5 2 5 3 3 3 3 4 4 3
      4 4 4 3 5 3 4 4 4 4 5 5 5 5
      5 5 5 5 5 5 5 5 5 5 3 5 4 5
      5 5 5 5 5 2 5 3 5 5 3 4 5 5
      1 1 1 1 5 5 4 1 1 1 1 4 4 5
      3 4 2 5 3 2 4 5 5 5 4 3 2 3
      2 4 3 1 4 4 4 3 5 4 3 4 3 3
      5 5 5 5 5 5 2 1 5 5 3 5 5 5
      5 4 4 5 5 4 4 4 3 5 4 5 5 4
      5 4 5 4 5 5 5 5 5 5 2 5 5 3
      3 4 5 4 4 5 5 5 4 4 2 2 4 3
      5 4 5 5 5 5 4 4 3 5 1 2 2 4
      3 4 3 5 3 5 4 4 3 5 1 2 3 2
      3 3 4 4 4 4 5 5 4 3 3 4 4 4
      3 2 2 4 5 3 3 4 3 2 2 3 2 3
      4 4 4 5 4 4 3 4 2 4 4 4 4 5
      4 5 5 5 3 4 2 5 4 4 1 3 4 4
      5 5 5 5 5 5 4 4 4 5 5 3 4 5
      5 3 4 3 2 2 1 2 4 2 4 3 4 5
      3 3 4 3 5 4 4 4 4 2 3 3 4 4
      4 4 3 4 4 4 4 4 3 2 3 4 3 4
      3 5 5 5 5 5 5 5 3 2 5 5 3 5
      5 4 4 4 5 5 3 5 5 5 2 3 5 4
      5 4 4 5 5 4 5 4 5 5 4 5 3 5
      4 4 3 1 4 3 3 4 3 4 2 4 3 4
      4 4 4 5 5 5 3 4 4 4 3 4 4 5
      end

      Comment


      • #4
        I'm a little confused here - you don't show your command so I'm guessing that you are using language in the same way that Stata does and are using the -mvreg- command; however, this command is not an MLE and does not retain any likelihood info and therefor you cannot use a likelihood ratio test

        if you are using some other command (or set of commands), please show exactly what you are telling Stata to do

        Comment


        • #5
          Yes exactly I think i am just confused between multiple regression and multi-variate regression. What i actually use is mvreg not MLE. Can you explain the difference?

          Comment


          • #6
            Coefficient Std. err. t P>t [95% conf. interval]
            GSATISFIED
            PSMTOTAL .2730627 .1075936 2.54 0.012 .0610427 .4850826
            ProsocialImpact .429828 .0624405 6.88 0.000 .3067849 .552871
            PAYSATISFIED .3841561 .0505283 7.60 0.000 .2845869 .4837253
            _cons -.3420355 .382228 -0.89 0.372 -1.09524 .4111689
            GMOTIVATED
            PSMTOTAL .2959937 .1095579 2.70 0.007 .080103 .5118845
            ProsocialImpact .3138417 .0635805 4.94 0.000 .1885523 .4391311
            PAYSATISFIED .2743497 .0514508 5.33 0.000 .1729627 .3757368
            _cons .2084445 .3892062 0.54 0.593 -.558511 .9754

            Comment


            • #7
              I am basically using mvreg because i have two dependent variables and I want an easier presentation. However, I have the same model with one less independent variable so I wanted to compare the two. I estimate the LRT on each model multiple regression for each of the dependent variables alone. Can i use that since mvreg seems to be a matter of presentation?

              Comment


              • #8
                Originally posted by Salma Aboelmaaty View Post
                . . . I have the same model with one less independent variable so I wanted to compare the two.
                test after mvreg does this.
                Code:
                mvreg GSATISFIED GMOTIVATED = c.(PSMTOTAL ProsocialImpact PAYSATISFIED)
                test PSMTOTAL
                is a test against the same model with that predictor omitted.

                I'd illustrate it, but your snippet of a data listing doesn't have PSMTOTAL. (Unless it's in there in disguise, say, as the sum of CV1 through ER2.)

                As a side note, your outcome variables have only five levels each, if your snippet listing is any indication. It's probably okay, but you'll need to be aware that multivariate linear regression does assume multivariate normality of the residuals. I'm not sure that I would bother testing for it, but you might want to at least take a look at the usual regression diagnostic plots for each of the two equations. If you're not happy with what you see, then consider gsem, specifying ordered-categorical outcome variables.
                Last edited by Joseph Coveney; 17 Aug 2022, 20:21. Reason: each has

                Comment


                • #9
                  Joseph Coveney Thank you so much. Is this a wald test? PSMtotal is not there because the dataex wouldnt allow me to copy all variables so I had to pick a few. I did the test you suggested on each indepdent variable and they all came back with 0 and pvalue <0 .. Does that mean they are all important?

                  Comment


                  • #10
                    Originally posted by Salma Aboelmaaty View Post
                    Is this a wald test?
                    Yes.

                    PSMtotal is not there because the dataex wouldnt allow me to copy all variables so I had to pick a few.
                    It's always better just to upload the dataset to the post as an attachment. If the forum's software gives you trouble about recognizing Stata's dataset file type, then you can either change the file name's suffix from .dta to .txt or export the dataset to a plain text file using outfile for uploading.

                    I did the test you suggested on each indepdent variable and they all came back with 0 and pvalue <0 .. Does that mean they are all important?
                    Not necessarily. Importance is a matter for interpretation.

                    Comment

                    Working...
                    X