Announcement

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

  • test of significance for curvilinear & curvilinear interaction effects in multilevel logit model

    Using Stata Version 14.2 on Windows 8 (64 bit)

    Example dataset:

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float funded byte category_group_id float(launch_year hasvideo lgoal duration) byte staff_pick float(fznar zinnovative)
    1 1 2015 1  9.903487 29.181053 .   -.1059211 -.5815727
    1 1 2011 1  7.313221        30 1   -.1557212  .0612783
    1 1 2011 0  6.214608 31.958334 0   -.1968106 -.5815727
    0 1 2014 0   6.39693        45 0   .33145735 -.5815727
    1 1 2012 1  8.006368        60 .    .1013649  .0612783
    1 1 2012 0  8.987197        30 1   -.0494278  .3827038
    0 1 2014 0  7.600903  59.95833 0   -.1968106 -.5815727
    0 1 2018 0   6.55108        10 0   -.1886733 -.5815727
    0 1 2016 0  6.761573        30 0  -.16098997 -.5815727
    0 1 2014 0  8.517193        30 0  .029723614 -.5815727
    end
    label var category_group_id "category_group_id"
    label var staff_pick "staff_pick"
    label var fznar "Factor score (Narcissism)"
    label var zinnovative "Standardized values of (innovative)     "

    I have hypothesized an inverted u-shaped relationship between funded (DV) and zinnovative (IV). I further hypothesized that fznar (Moderator) will moderate this curvilinear relationship.

    Question 1: test of curvilinear relationship in logit models

    I ran below model to test my hypothesized relationships.

    Code:
    melogit funded i.category_group_id i.launch_year hasvideo lgoal duration staff_pick c.zinnovative##c.zinnovative ||country:
    Query on testing significance of curvilinear effect.

    1. I understand that the logit model I have run gives me coefficients of the log-odds of DV and not of DV itself. Hence I cannot determine whether I have a significant curvilinear relationship or not between DV (funded) & IV (zinnovative) by interpreting model coefficients.

    2. I can plot the relationship to visualize it using margins command.

    Code:
    margins, at(zinnovative = ( -0.5 (.5) 3.5))
    marginsplot
    Plot is attached as png for view. File name: funded_innovativeness.png

    Plot shows that there is a curvilinear relation but it is not a statistical test.

    3. Marginal effects can be used to test curvilinearity. My hypothesis is about inverted u-shaped relationship.

    I chose not to run below command because that would have given me average marginal effect and I am not aware how average marginal effect could be interpreted as statistical test of curvilinear effects.

    Code:
    margins, dydx(zinnovative)
    instead I ran below command. Calculating marginal effects at various values of IV and plotting it.

    Code:
    margins, dydx(zinnovative) at(zinnovative = ( -0.5 (.5) 3.5))
    marginsplot
    Plot is attached as png for view. File name: dydx(innovative).png

    In the attached plot, I can easily see that the slope is changing. Slope started with a positive value, then slowly became zero and then turned negative and kept getting larger in negative values with increasing value of IV. This is peculiar of what I was expecting as a change in slope for an inverted -shaped relationship.

    However, I still do not have any statistical test which says that the slopes at different values of IV (zinnovative) are indeed different. I believe that is what I need to prove that my relationship is not linear but curvilinear and then I can use the predicted margins plot to show the nature of the relationship. Please suggest how I can statistically test that the slopes are changing at different values of IV.


    Question 2: test of curvilinear interactions in logit models

    In step 2 of analysis, I ran above model with interaction term - Narcissism (fznar). It is a moderating variable for me. I expect that the presence of high levels of moderating variable (M) will affect the curvilinear relation between my IV (zinnovative) and DV (funded).

    I ran below code for my model.

    Code:
    melogit funded i.category_group_id i.launch_year hasvideo lgoal duration staff_pick c.fznar##c.fznar c.zinnovative##c.zinnovative c.zinnovative##c.zinnovative#c.fznar ||country:

    Query on testing significance of curvilinear interaction effect.

    1. I can plot the relationship to visualize it using margins command. I plotted the relation between DV and IV at two levels of Moderator.

    Code:
    margins, at(zinnovative = ( -0.5 (.5) 3.5) fznar = (-0.189, 0.195))
    marginsplot
    Plot is attached as png for view. File name: funded_innvativeness_narcissism.png

    Now from the plot, I can see the interaction does not look significant. At almost all values of IV, I see the error bars overlapping for low and high values of Moderator. But how to say it statistically?

    2. I calculated marginal effects. This time the question is not about inverted u-shaped curve. This time, I have two curves and I have to test that the shape of one curve is different from the other.

    Code:
    margins, dydx(zinnovative) at(zinnovative = ( -0.5 (.5) 3.5) fznar = (-0.189, 0.195))
    marginsplot

    Plot is attached as png for view. File name: dydx(zinnovative_fznar).png

    In the attached plot, I can see two lines. One is the change in slope of the relation between IV (zinnovative) and DV (funded) at low levels of Moderator (fznar) and other one is the change in slope at high levels of moderator (fznar). It looks like that the slopes of these two lines are not different. My query is how can I prove that statistically.

    Thank You.
    Attached Files

  • #2
    You didn't get a quick answer. This may reflect that you have a pretty long complex posting.

    If you want to compare or test for differences in marginal effects, then I think you need to look at margins with contrasts.

    Comment


    • #3
      Hello Phil,

      Thank you for your input. I will explore margins with contrast options. Do you know of any other way in which curvilinear interactions can be tested in logit models.

      Comment

      Working...
      X