Announcement

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

  • Multi level modelling cross level analysis

    I want to examine the effect of educational attainment(xvar) on prejudice(yvar) (both 1. level variables) moderatet by current regimetype in the country(xvar) (2. level variable).

    I am using the most recent data from the World Value Survey to examine the effects of the interaction, my problem is the following:

    In order to assign every country a regimescore I have used the Freedomhouse reports from 2012/13 to generate a new "regimetype" variable, and assigned every observation in the data set with the appropriate score (from 1 to 7). My problem is then: how do i aggregate the scores from each observation, to make it a group level variable? Or is it possible just to run the mixed command like
    - mixed prejudice(yvar) c.education(xvar)##c.regimetype(xvar2)||regimetype :

    I hope this question makes sense, I am quite new to multilevel analysis.

  • #2
    People commonly confuse the syntax of levels in Stata's multi-level modeling commands with the level at which a particular variable is defined, and I think that is what you have done as well. Your variable regimetype is apparently defined at the country level. But it is not a variable that defines a level in the nesting hierarchy; country itself does that. What I think you want is:

    Code:
    mixed prejudice c.education##c.regimetype || country:
    This model allows the regime type (which is defined at the country level) to moderate the effect of education, and also accounts for the nesting of individual observations within country.

    By the way, this is not what is ordinarily meant by the term "cross-level interaction." A cross-level interaction would arise if you used a random slope at the country level. For example (and I'm not saying this is what you need, just giving an example):
    Code:
    mixed prejudice education regimetype || country: education
    In this model there is a true cross level interaction between country and education. That is, the effect of education itself is modified by which country the subject is in.

    Comment


    • #3
      Okay, thanks! I think I understand it now.
      - The hypothesis I am currently examining is: In autocracies the highly educated are more likely to be prejudiced towards minorities. So i want the democracy score (regime), to vary across countries and moderate the effect of education on prejudice.

      Then i guess the correct command to use would be
      mixed prejudice i.education##c.regimetype || country: // (I am using the i. because my education variabel is categorical).

      My next question is then: If i want to control for 3rd variables, (like gender GDP etc.), can i just write them in the command after the interaction command, or where should they be in the syntax?

      Comment


      • #4
        My next question is then: If i want to control for 3rd variables, (like gender GDP etc.), can i just write them in the command after the interaction command, or where should they be in the syntax?
        Yes, you can list them either immediately before or immediately after the i.education##c.regimetype term.

        They should not go after || because that would turn them into random slopes (and incorrectly done at that, because random slopes must always have corresponding terms in the fixed-effects part of the model). And if you put them before prejudice, prejudice would no longer be the outcome variable.

        Comment


        • #5
          Thank you, this helped me a lot!

          Now that i have made the estimation command, i want to calculate the predicted values for the effects for each level of education.
          Is that possible given that I have a categoric independent variable and a continuous moderating variable?

          I have so far made the margins command for the post estimation of each level of democracy score (the moderator).
          margins, dydx(Eduref) at(DemSc=(1/7))

          How do i get the predicted values for each level of educational attainment?

          Comment


          • #6
            I assume that Eduref is the variable you originally called education and DemSc is what you previously called regimetype.

            Code:
            margins Eduref, at(DemSc=(1/7))

            Comment

            Working...
            X