Announcement

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

  • Marginal effects of a categorical-categorical interaction term after Tobit regression (+ predicted means)

    Dear forum members,

    This is the first time I have to work with Tobit regressions and with the Stata command 'margins' and I'm relatively inexperienced with Stata in general, so I am very open to learning from you.
    I have tried as best as I can to look in the forum archive and other sources to find the solution to the two problems I have, but I am a bit unsure about the right approach and worried that I choose wrong and thus obtain incorrect results/conclusions.

    My continuous dependent variable is amount of time (spent on child care), my two categorical independent variables are maternal education (level 1: primary, level 2: secondary, level 3: tertiary) and child age (level 1: 0-4, level 2: 5-12, level 3: 13-17), and my two continuous control variables are family size and maternal age.
    Based on advice in this forum (e.g. from Richard Williams to use factor notation instead of manually generating dummies or interaction terms), I constructed my regression equation as follows: tobit allchildcare1 ib2.edtry i.agekid i.edtry#i.agekid nchild age1, ll(0).

    First, I need marginal effects on the unconditional expected value (I think these are average marginal effects (AMEs)?), which - if I've understood it correctly - can be found by using the command: margins, dydx(*) predict (ystar(0,.)) post. (Is that true, also in this setting with categorical independent variables?)
    However, Stata does not present the marginal effects for the four interaction terms. I read that this is perfectly normal, but I really need those (and the standard errors) for my analysis (mainly to find out whether they are significant or not).
    So, in short, how can you use Stata to obtain the marginal effects for categorical-categorical interaction terms?

    I came across several possibilities online but I am unsure which I should use, i.e. which one is correct.
    For example, to find the marginal effect for primary x 5-12 I thought of margins, dydx(edtry) at(agekid==2) predict (ystar(0,.)) post but I get a different effect if I use margins, dydx(agekid) at(edtry==1) predict (ystar(0,.)) post (maybe that's obvious, but now I don't know which to use), and the results seem strange to me.
    Vince Wiggens (https://www.stata.com/statalist/arch.../msg00293.html) suggests margins r.edtry#r.agekid (I have again added the option predict (ystar(0,.))), but then you get 'contrasts of predictive margins' and no longer 'average marginal effects' like the other marginal effects and I am unsure about that (I think that's something else).

    [Second, I want to use the marginal effects to generate predicted means (predicted mean amounts of time spent on child care) at specific levels of maternal education and child age (to ultimately display those in a nice figure using e.g. 'marginsplot'). How can I do that with Stata?]

    Thanks in advance for any help or advice you can offer. If you need more information first, then please let me know.

    Anna

  • #2
    However, Stata does not present the marginal effects for the four interaction terms. I read that this is perfectly normal, but I really need those (and the standard errors) for my analysis (mainly to find out whether they are significant or not).
    So, in short, how can you use Stata to obtain the marginal effects for categorical-categorical interaction terms?
    The reason it's perfectly normal is that there is no such thing as the marginal effect of an interaction term. Since they don't exist, you are mistaken in believing that you need them. If you want to assess whether your interactions are statistically significant or not, you do that from the statistics shown for the interaction terms in the -tobit- output itself, not from -margins-. Or, since your variables have multiple levels, you might want to do a joint significance test with -testparm i.edtry#i.agekid-.

    Comment


    • #3
      Originally posted by Clyde Schechter View Post

      The reason it's perfectly normal is that there is no such thing as the marginal effect of an interaction term. Since they don't exist, you are mistaken in believing that you need them. If you want to assess whether your interactions are statistically significant or not, you do that from the statistics shown for the interaction terms in the -tobit- output itself, not from -margins-. Or, since your variables have multiple levels, you might want to do a joint significance test with -testparm i.edtry#i.agekid-.
      That's strange, I'm really confused now. The reason is, I follow the research approach in a published paper where they do report marginal effects for the interaction terms after a Tobit regression (although it is not possible for me to know (anymore) how these were derived exactly). Another published study with the same topic uses OLS instead of Tobit but also reports the marginal effects of interaction terms. These must come from somewhere, but you think it's all wrong? Also online I find mixed info on this, some say that we can find these using Stata as long as it is no continuous-continuous interaction?

      But in terms of a plan you would really suggest abandoning this whole idea despite all this and just present/work with the Tobit-coefficients instead of marginal effects? That should be possible as well in this setting as long as I know for each interaction term whether it is significant or not since that is essential for me to be able to draw conclusions and compare it with the outcomes of this paper I mentioned.

      Comment


      • #4
        These must come from somewhere, but you think it's all wrong?
        I know it's wrong. But don't take my word for it. Here's a proof. Let's take a simpler case of an interaction i.x#i.y where x and y are each just dichotomous 0/1 variables. If 1.x#1.y had a marginal effect, it would be the expected change in the outcome variable (it doesn't matter what that happens to be, nor whether the regression is linear or anything else) associated with a unit change in 1.x#1.y. But, there are three different ways that 1.x#1.y can change by one unit. We can go from any of x = 0 y = 1; x = 1, y = 0; or x = 0, y = 0 to x = 1, y = 1. Now, it might be that the first two would produce the same change in the outcome variable, but the last one must produce a different change in the outcome variable from the other two (unless x and y both have zero effect on the outcome.) So it is impossible to define a marginal effect because there is no principled way to choose among the two or three possible different changes in outcome associated with a unit change in the interaction term. When x or y has more than two levels, the number of different changes in outcome associated with a unit change in some interaction term grows even larger.

        So what is it you are seeing in these articles? Well, possibly you are seeing other things that are being misbranded as marginal effects of the interaction. Sometimes people will present the marginal effects of both x and y at each value of y and x, respectively. But that's not a marginal effect of the interaction. That's four simple marginal effects of x and y. Sometimes people will, instead of using factor variable notation, create their own interaction variable and include it in the model, and then report the coefficient (or, in a non linear model, some transformed coefficient) of that, or even run that as -margins, dydx(homebrew_interaction_term). But that isn't a marginal effect of the interaction either because it does not actually represent "the" change of outcome associated with a unit change in x#y. It is, instead, the unit change in outcome if this homebrew "marginal effect" were to change ny 1 unit while x and y themselves did not change at all--which is, of course, impossible. I think that generally when people do these things, it is based on not understanding what they are doing, or misusing language rather than intent to deceive. But, intentionally or not, they are saying something demonstrably incorrect.

        But in terms of a plan you would really suggest abandoning this whole idea despite all this and just present/work with the Tobit-coefficients instead of marginal effects?
        I am not suggesting you abandon interaction modeling. Nor am I suggesting you refrain from presenting the results that -margins- does give you. You said that the reason you wanted the marginal effects of the interaction term was so that you could tell if the interaction is significant: you can, and should, do that from the tobit output for the interaction terms.
        Last edited by Clyde Schechter; 19 Dec 2022, 23:06.

        Comment


        • #5
          Thank you very much Clyde for your clear explanations! It makes sense now. I was already wondering about what thé marginal effect of an interaction term would even be/mean and whether it would exist or not, but if a published paper (or in fact several) does report these I had to assume that they were right and that these effects do exist/can be calculated, especially if they are front and center of the analysis in the papers and what all of the conclusions are based on. However, based on what you wrote and your experience, I know now that I should really change my approach a little to what I had in mind based on these papers. It is indeed the goal to test whether the (individual) interaction terms are significant (the actual numbers/'margins' are not discussed/interpreted), so instead of computing an incorrect marginal effect and testing whether it is significant (like in the papers), I will just look at the original tobit output. Thanks!

          Now I do not have the 'marginal effect for the interaction term', can I still generate predicted means (predicted mean amounts of time spent on child care) at specific levels of maternal education and child age (to ultimately display those in a nice figure using e.g. 'marginsplot')? (Since the paper mentions that the marginal effects should be used.)
          How can I do that with Stata? The terminology in 'margins' and 'marginsplot' is a bit confusing for a beginner and maybe I need another command, so that's why I ask.

          Lastly, there is some discussion about whether to use the Tobit model or OLS in the case of time-use data. Using the Tobit model seems obvious here, but some researchers argue that OLS might still be better, e.g. in the case when reported zeros are the result of mismeasurement, or when the assumptions of the tobit model (normality and heteroskedasticity of the error terms) are violated. (One of my sources also uses OLS, while the main paper and another use Tobit.) What is generally the best approach here (e.g./and in case we have one or both of these problems)? Report the results of both models? (I did perform a check already and found that the qualitative (and quantitative, obviously) results clearly differ between Tobit and OLS in some cases.) The papers I read do not mention this really, but I think it's important.

          Thanks so much for the help - Anna

          Comment


          • #6
            Now I do not have the 'marginal effect for the interaction term', can I still generate predicted means (predicted mean amounts of time spent on child care) at specific levels of maternal education and child age (to ultimately display those in a nice figure using e.g. 'marginsplot')? (Since the paper mentions that the marginal effects should be used.)
            Yes, by all means you can, and should, do that. In my opinion, when we have polytomous variables being interacted, as here, it is best to show the predictive margins.
            Code:
            margins edtry#agekid
            will give you the predicted values of allchildcare1 at each combination of values of edtry and agekid. This is a complete description of the interaction of these variables. Sometimes it is helpful to also plot the results. And just typing -marginsplot- as the very next command will do that. The graph may be somewhat unaesthetic, but if you think the patterns it shows are of interest, you can beautify the graph by using almost any of the options that are available in all -graph twoway- commands when you run it again. Think also about the particular statistic whose predicted values you want to show. By default, -margins- after -tobit- will give you the expected values of the linear predictor in the -tobit- model. However, you can request other statistics (instead or in addition) with the -predict- option. See -help tobit_postestimation##margins- for details.

            An alternative way to exhibit an interaction, and one that I think works better when the interaction involves continuous variables, or one dichotomy and one continuous, is to show the marginal effects of the variables at chosen values. You can do that with polytomous variables as well, but I think that the results are more difficult to understand. The syntax in your case would be
            Code:
            margins edtry, dydx(agekid)
            margins agekid, dydx(edtry)
            As I say, it is difficult to grasp the meaning of these results when, as in your case, the variables are both polytomous, so I generally avoid this.

            Lastly, there is some discussion about whether to use the Tobit model or OLS in the case of time-use data. Using the Tobit model seems obvious here, but some researchers argue that OLS might still be better, e.g. in the case when reported zeros are the result of mismeasurement, or when the assumptions of the tobit model (normality and heteroskedasticity of the error terms) are violated. (One of my sources also uses OLS, while the main paper and another use Tobit.) What is generally the best approach here (e.g./and in case we have one or both of these problems)? Report the results of both models? (I did perform a check already and found that the qualitative (and quantitative, obviously) results clearly differ between Tobit and OLS in some cases.) The papers I read do not mention this really, but I think it's important.
            This is a difficult question. My own inclination is to focus less on the technical assumptions underlying the different regression models and more on fidelity of the model to the data generating mechanism. That is, if the values of the observations are truly censored at 0, then I would prefer the -tobit- model because in OLS you are (mis) representing the outcome variable values as representing (up to random error) the true values of the underlying variable. I am less worried about things like normality or homoskedasticity because the results are usually quite robust to violations or normality in other than very small samples, and homoskedasticity can be dealt with by using robust standard errors. Nevertheless, if the true outcome values are only rarely below zero, and only slightly so, then the mis-specification coming from using OLS may not make much difference. (Of course, in that case, the two analyses will produce very similar results.) But that is just my opinion, and I know that some people feel otherwise. I don't think that anyone has yet said the last word on how to select models.

            Finally, if one effect of this thread has been to shake your faith in things you see in publications, that is a good thing. It is a terrible phenomenon in the culture of science that results of studies appearing in peer-reviewed journals are venerated as some kind of gospel. Frankly, there is a great deal of plain crap in the peer-reviewed literature, and even in the most respected journals. I never assume that the findings of published studies are correct, nor their methods either sensible or properly implemented unless my detailed reading of the paper persuades me it is so.

            Comment


            • #7
              Thank you very much Clyde for the clear explanations and suggestions! I learned a lot from you; I think I can overcome my hurdles now. This thread indeed also has 'opened my eyes' in terms of what you wrote in the last paragraph (as a student you sometimes do not know what to expect/believe and papers can seem very impressive so hearing something like this really helps), thank you. Best, Anna

              Comment


              • #8
                Hi Anna,

                I found the following link helpful: https://clas.ucdenver.edu/marcelo-pe...ure_lisbon.pdf

                Hopefully this helps!

                Comment

                Working...
                X