Announcement

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

  • _all: in mixed models: What if it is followed by a continuous variable without the "R." part?

    Dear Statalist,

    I am trying to better understand how Stata deals with the _all: option in mixed/xtmixed commands. What I specifically am looking to understand is what exactly is happening when the _all: option is followed by a continuous variable rather than the more commonly used R.identifier_variable approach. From what Clyde writes in this forum, I understand that without the R. Stata tries to fit a model with random slope specified to the variable that comes after _all:. At what level then would the slope of that variable be varying?

    Let me provide an example to clarify what I am looking for. I have a dataset with multiple brands (denoted by i) and each brand has several observations across months (denoted by t). The dependent variable of interest is sales (i.e., Salesit) and the independent variable of interest is brand's monthly advertising expenditures (i.e., Advit). What model would be estimated if I run the following command?
    Code:
     mixed sales adv || _all: adv
    Will it try to estimate this model? Salesit = a + bit * Advit+ eit (with bit = b + uit). If so, is my interpretation correct that the b parameter that is reported in the main part of Stata output would be the average effect of advertising on sales after accounting for time-specific or brand-specific deviations in the effectiveness of advertising on sales through the inclusion of uit?

    Is there any document going into the detail of how the above model is estimated?

    Thank you very much in advance.

  • #2
    Frankly, I don't know what model would be estimated by the code you show. When I try to reason it out I come up with something that just doesn't make any sense at all.

    So let's go the other way. It sounds like you want to estimate Salesit = a + bit * Advit+ eit (with bit = b + uit), where i indexes brands and t indexes time (repeat observations). Somewhere you have a variable that identifies brands: I'll just call it brand. You estimate this model with:

    Code:
    mixed sales adv || brand: adv
    The coefficient of adv reported in the main part of the Stata output would be the average slope of sales on advertising, averaged over all brands. The bottom part of the output would give you the variance (or s.d. if you're using an older Stata) of the sales:advertising slopes across brands.

    Comment


    • #3
      Thanks a lot Clyde for your response.

      Correct me if I am wrong but I think the code that you wrote in your response estimates Salesit = a + bi * Advit+ eit (with bi = b + ui) and not Salesit = a + bit * Advit+ eit (with bit = b + uit) . Isn't it the case?

      I am looking for a model specification that through only one random term it allows for the effect of advertising on sales to vary across brands and across time. I believe it can be achieved if I specify two non-nested levels (one being at brand level and another at time level) and then specify random slope for advertising at both levels (hence bit = b + ei + vt = b + uit). However I would rather do it with one random parameter than two.

      Comment


      • #4
        You are correct about the model that my code would estimate. I didn't pay careful enough attention to the subscripts.

        But the model you offer as an alternative is unidentifiable. i and t jointly uniquely identify observations in the data. Consequently, it is impossible to distinguish between a different value of bit for each observation and some different adjustment to eit, the residual error. Your final idea of bit = b + ei + vt is workable, as a crossed effects model. That, as you note, requires two different levels (though they would not be nested in each other.) There is no one random parameter model that will do what you want in this kind of data.

        Comment


        • #5
          Thanks Clyde for your help.

          Please update me if you ever figured out what Stata does when using the _all:adv specification (just curious!).

          Comment

          Working...
          X