Announcement

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

  • specifying stored coefficients in test

    I am running two multilevel models and storing the coefficients. I then want to test of the product of two coefficients, one from each model, is zero as a simple way to get at indirect effects/moderation. But I'm not sure how to indicate the stored coefficients. Here's my syntax

    mixed lifesatis airsatis wtrsatis presenv LNhhincomeC female ageC tertedu eparttime unemployed nolabor marrdom divsepwid hlthprob LNcintenseC pctprotectC LNgdppcC meaneduC incgini19C wealthgini19C || WP5: airsatis wtrsatis presenv LNhhincomeC female ageC tertedu eparttime unemployed nolabor marrdom divsepwid hlthprob, reml

    estimates store full_model

    mixed airsatis LNhhincomeC female ageC tertedu eparttime unemployed nolabor marrdom divsepwid hlthprob LNcintenseC pctprotectC LNgdppcC meaneduC incgini19C wealthgini19C || WP5: LNhhincomeC female ageC tertedu eparttime unemployed nolabor marrdom divsepwid hlthprob, reml

    estimates store airsat_model

    Then when I try to test

    test (([full_model]airsatis)*([airsat_model]LNcintenseC))=0
    equation [full_model] not found
    r(303);

    Help appreciated!
    Last edited by Tom Dietz; 31 Mar 2023, 16:06.

  • #2
    You need to find a way to have both estimates in memory at the same time. This means combining the estimates using a command such as suest or jointly estimating the models. Unfortunately, suest does not support a good number of estimation commands and for very complex models, joint estimation is not easy. I don't deal that much with random effects, so I do not have an answer on how you should proceed. Second, test deals with linear hypotheses - so you need to look at testnl in this instance.

    Code:
    help testnl
    Last edited by Andrew Musau; 31 Mar 2023, 16:02.

    Comment


    • #3
      Thanks. Good point about testnl, I had forgotten about that. I will experiment with suest.

      Comment


      • #4
        And you are write that suest does not support mixed. So perhaps this is not doable in Stata.

        Comment


        • #5
          suest is a dead end, it does not support mixed. I would check out cmp from SSC by David Roodman. I think you may be able to estimate both models simultaneously with it.

          Code:
          ssc install cmp, replace
          help cmp

          Comment


          • #6
            Thanks, will give it a try.

            Comment

            Working...
            X