Announcement

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

  • How do I interpret squared/quadratic term's coefficient?

    Hi all,

    I am trying to estimate the effect of local unemployment on the employment outcomes of the citizens:
    employed=LUR+LUR2+X+L+Y_FE+M_FE+error

    where LUR is the local unemployment rate (min 0.01 max 0.11), X are individual characteristics and L local characteristics and I control for fixed effect of the year and municipality. Employed is a dummy variable, where 1 indicates employed and 0 otherwise.

    As I have panel data I am estimating with Random Effects (after having checked Hausman test):
    xi: xtreg employed c.unemployment##c.unemployment $id $municipality i.year i.municipality, re i(id) vce(robust)

    where $id $municipality are the individual and municipality characteristics I account for.

    The estimates that I get for unemployment and unemployment2 are 3.4 and -36 respectively (both significant), so the turning point is in 0.047.

    At this point I wonder how do I interpret the results then?

    My guess would be that a one percentage point increase in the local unemployment increases the probability of being employed until the point when unemployment rate is over 4.7%, then the local unemployment rate affects negatively the employment outcomes of the individual, does this make sense?

  • #2
    Ruth:
    I would say that, when adjusted for the remaining predictors, a one point increase in local unemployment rate increases the employment rate (not the probability of being employed which differs from a rate) until the .employment rate levels off at 4.7% (stationary point); then decrases it after the stationary point.
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #3
      Ruth:
      you can also visually inspect the quadratic relationship via -margins- and -marginsplot-:
      margins, at(unemployment=(0(0.01)0.11))
      marginsplot, noci
      Kind regards,
      Carlo
      (Stata 18.0 SE)

      Comment


      • #4
        Not so fast! Because of the way you did your regression, -margins- will not work correctly! You were on the right track, including factor variable notation. But then you nullified it with the damnable xi: prefix. So go back and remove the xi: prefix, re-run your regression (your results should not change), and then run -margins-.

        More generally, you should do your best to forget that you ever heard of -xi-. While it is still supported in Stata, and there are even a few situations where it needs to be used, those circumstances are very uncommon. (Moreover, most of them are archaic commands whose function is incorporated in a more modern command that does support factor variable notation.) Meanwhile, by using -xi:- you interfere with Stata's ability to interpret your factor variable notation. -xi- and factor-variable notation are incompatible, and the latter is better.

        Comment


        • #5
          Thank you both for your inputs.

          I have been able to run the commands that Carlo suggested, and the margins plot makes the interpretation easier indeed!

          The reason I was using xi prefix is to make out of the year and municipality variables dummies for each values (which exclude the most common value). Clyde, you suggest that the margins calculation could be mislead by the xi prefix? Do you know other way to create dummy variables for each value? I had been using tab year, gen(year_) before, but I was happy when I found about xi as it gives the name of the value to the dummy variable and it does not actually save the variables -because that would mean extra 100 variables.

          Comment


          • #6
            Read -help fvvarlist-. Because you used the factor variable notation for the quadratic term correctly, I assumed you understood factor variable notation generally. But apparently not. Just run:

            Code:
            xtreg employed c.unemployment##c.unemployment $id $municipality i.year i.municipality, re i(id) vce(robust)
            as is (without the xi: prefix). Stata will see the i. prefixes on year and municipality and will create "virtual" indicator ("dummy") variables for the levels of those for you. When you use -xi:-, you actually prevent Stata from doing that because -xi:- removes those terms from the regression command and replaces them with a bunch of _I* variables. But the -margins- command doesn't understand those _I* variables and so does not know how to deal with them properly. When you drop the -xi:-, the virtual indicator variables that Stata creates will be appropriately recognized by -margins- and handled accordingly. Putting it more briefly: there is no need to create your own indicator variables. Better to let Stata's factor-variable notation do it for you automatically.

            Comment


            • #7
              The code for xi: is probably frozen. But I might be tempted to unfreeze it to have it print out a message like "Warning! You are probably making a horrible mistake by using the xi: prefix!"

              Even if you weren't going to use margins, I would avoid xi just because its output looks so hideous.

              There are some user-written commands that do not support factor variables (especially older commands) and even a few official Stata commands. The biggest command that comes to mind is sem. But even with them I might be tempted to create the dummies myself just so the output would look nicer.
              -------------------------------------------
              Richard Williams, Notre Dame Dept of Sociology
              Stata Version: 17.0 MP (2 processor)

              EMAIL: [email protected]
              WWW: https://www3.nd.edu/~rwilliam

              Comment


              • #8
                Thanks again! I dropped finally the xi prefix and used the factor variable notation; I agree that the output looks nicer now.

                PS. In case someone (like myself) was using xi because of string variables, you can encode them as explained in this site and use the factor notation on the new encoded variable -in the output you will still see the names instead of the codes.

                Comment


                • #9
                  Hi again, I just realised that when using the factor variable notation and I use outreg2 to get the results into an excel, the factor variables are not reported, does anybody have a solution for this?

                  Comment


                  • #10
                    As always, you're more likely to get a useful answer if you follow the faq on asking questions - provide Stata code in code delimiters, Stata output, and sample data using dataex.

                    I certainly have done factor variable interactions and outreg2 has written them into word files with no problem. I usually want to change the row labels for final manuscripts, but that is easy - you do it once then copy and paste. So, I suspect something is wrong in your specification.

                    Comment

                    Working...
                    X