Announcement

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

  • Cross-Classified Model

    Hello all,

    I am trying to estimate a cross-classified model within the mixed command. I believe I have at least close the right code and I am hoping that someone could help me get more clarity. To sum things up, I have observations at the firm-state level (many observations for each firm and many observations within states) across 4 periods. I believe that observations are cross-classified within firms and states, so I would like to model the intercept for firms and states as random. I also have interactions that I am trying to estimate as well. So far my code is:

    mixed y c.x1##c.x2 x3 x4 x5 x6 i.year || _all: r.firm||_all: r.state, var ml


    However, when I estimate this model it provides results for 1 cluster, is this correct? I was expecting more detailed information for how many firms (50), how many states (50), and how many firm-state combinations (2500).

    Two more questions:
    If x2 is a 'state level' predictor, do I need to put it or the interaction in the 'random' part of the model?
    Also, to get the ICCs for firm or state, I understand that I can divide their respective variance estimates by the residual...but how do I get the ICC value for the firm-state dyad?


    Thank you in advance.









  • #2
    The output shows that the number of groups is 1. This is an artifact of the way Stata makes you specify cross-classification. There is, after all, only one group for _all, which is what you have to specify. If the number of observations reported is correct, you are probably OK here.

    I'm not sure what you are looking to do as far as ICC's go. The ICC isn't uniquely defined in cross-classified models. You can, of course, calculate whatever ratios of (sums of) variance components you like, but in this context they aren't meaningful in the way they are with hierarchical models.

    Concerning x2 being a state-level predictor, that doesn't matter. Placing a variable in a random component level of the model has only to do with the level(s) at which you want its coefficient to vary. It has nothing at all to do with the level at which that variable is defined, nothing at all. Your model appears correctly specified.

    You can also make your model a bit more efficient both in terms of memory and convergence time by rephrasing it as:

    Code:
    mixed y c.x1##c.x2 x3 x4 x5 x6 i.year || _all: r.firm || state: , var ml
    This assumes that there are more states than firms. If it's the other way around, do it as:

    Code:
    mixed y c.x1##c.x2 x3 x4 x5 x6 i.year || _all: r.state || firm: , var ml
    The PDF documentation that comes with your installation explains why this notation still fits a crossed-effects model even though it looks like nesting, and why this notation leads to estimation requiring fewer resources.

    Comment


    • #3
      Hi Clyde,

      Thank you! Very helpful response. I did notice that in the PDF documentation, but I didn't quite understand if that was how it worked, so I appreciate you explaining that for me. I have a couple follow-up questions if I may.

      Why are ICCs not uniquely defined for cross classified models and why are they not as meaningful? Can I read some citations that support this? I was thinking it could be valuable to report how correlated observations are within firms and how correlated they are within states. I believe I can easily get this information by dividing each of the respective variance estimates by the residual estimate and obtain the values this way. However, I'm not sure if obtaining how correlated observations are within firm-state dyads would be helpful as well. Would it be valid to run the model as a nested model (i.e., firms nested within states or states nested within firms) and type iccvar postestimation to obtain how correlated observations are within the firm-state dyad? Furthermore, would it even be useful?

      Furthermore, if I placed a state level predictor (e.g., x2) within the random component level of the model, what would be the rationale for wanting its coefficient to vary? It sounds (or seems) like I can obtain near identical results either way, whether x2 is specified in the random component level or just specified in 'level 1.'

      Last, is there a way to specify the robust option along with:

      mixed y c.x1##c.x2 x3 x4 x5 x6 i.year || _all: r.state || firm: , var ml

      e.g.,

      mixed y c.x1##c.x2 x3 x4 x5 x6 i.year || _all: r.state || firm: , var ml robust

      Stata returns the message 'robust variances and pweights not supported when highest-level group encompasses all the data'




      Thank you for your guidance!

      Comment


      • #4
        Why are ICCs not uniquely defined for cross classified models and why are they not as meaningful? Can I read some citations that support this?
        See https://www.stata.com/statalist/arch.../msg00517.html.

        Would it be valid to run the model as a nested model (i.e., firms nested within states or states nested within firms) and type iccvar postestimation to obtain how correlated observations are within the firm-state dyad? Furthermore, would it even be useful?
        No. Nested and crossed random effects are rather different beasts. ICC's derived from the nested model would not be applicable to the crossed model. The link shown in response to the first question shows you some calculations, and some caveats about them.

        Furthermore, if I placed a state level predictor (e.g., x2) within the random component level of the model, what would be the rationale for wanting its coefficient to vary? It sounds (or seems) like I can obtain near identical results either way, whether x2 is specified in the random component level or just specified in 'level 1.'
        Specifying a variable within the random component level of the model, e.g. -|| firm: x2- means that your model includes a random slope for x2 with variation at the firm level. The short way of saying it is "Every firm has its own slope for x2." Another way of saying it is there is a firm X x2 interaction. This is a modeling decision that you would make based on your understanding of the underlying science, just as you would if deciding whether to include an interaction into a one-level model.

        Last, is there a way to specify the robust option along with

        mixed y c.x1##c.x2 x3 x4 x5 x6 i.year || _all: r.state || firm: , var ml

        e.g.,

        mixed y c.x1##c.x2 x3 x4 x5 x6 i.year || _all: r.state || firm: , var ml robust
        No. The error message is self explanatory. Generally when Stata doesn't support something like this, it is for sound statistical reasons, but occasionally it's just because the programming complications were deemed not worth the increment in functionality. I don't know which it is in this case, but I think it's the latter.

        Comment


        • #5
          Hi Clyde,

          Thank you for providing further clarification. However, you lost me as to the specification of variables in the random components level of the model. I have an understanding of my underlying science, but I'm a bit unclear on how to model it empirically with cross classified models. Let me start from the top to make sure my model will be correct, starting from:

          mixed y c.x1##c.x2 x3 x4 x5 x6 i.year || _all: r.state || firm: , var ml

          I see that this syntax models the potential non-independence of observations within states and firms by having random intercepts for both.

          Y is a dependent variable observed at the firm-state dyad (varies by state and firm for each time period)
          x1 is an independent variable observed at the firm-state dyad (varies by state and firm for each time period)
          x2 is a state level predictor observed for each state (only varies by state for each time period)
          x3 is a state level predictor observed for each state (only varies by state for each time period)
          x4 is a firm level predictor observed for each state (only varies by firm, constant across states within each time period)
          x5 is a firm level predictor observed for each state (only varies by firm, constant across states within each time period)
          x6 is a firm level predictor observed for each state (only varies by firm, constant across states within each time period)

          Am I still correct in using the above syntax or should I think about using different syntax to run this model?

          Last, the Stata forum post you linked to suggested that it does make sense to conceive of ICCs in a crossed model so I am a bit at a loss there as well.

          Also, I should note that I have already run the data using a 'single level' model with fixed effects for firm, state, and time, but I am running the mixed model as a robustness check, so it is important to me to figure out the hlm approach.

          Thank you for your patience and wisdom.

          Comment


          • #6
            Last, the Stata forum post you linked to suggested that it does make sense to conceive of ICCs in a crossed model so I am a bit at a loss there as well.
            Right, Clyde lost me there as well. The link he gives goes to a discussion where a user asked "Does it even make sense to think of ICCs in a crossed model?" and Roberto Gutierrez of StataCorp responded this way:

            It does makes sense and your calculation is correct, provided that the two observations are in the same year but do not have the same "NAME". If they did also share the same value of NAME, then you would add var(_cons) to the numerator.
            To put this all in terms of the model that's already been presented on this page, it seems to me that if observations (Level 1) are cross-classified by states and firms (both at Level 2) a researcher would want to start by running two separate empty models just to partition the variance in the two directions and see if there really are significant differences between firms and between states.

            Code:
            mixed y || state: , var ml
            estat icc
            mixed y || firm: , var ml
            estat icc
            If either or both of those ICCs turn out to be insignificant, the user could simplify the model by dropping that classification.

            Am I just confused about all this? I'd love to see Clyde or some other expert weigh in here. If the approach I've described is wrong, what did Roberto mean when he said that it does make sense to think of ICCs in a crossed model?

            Comment

            Working...
            X