Announcement

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

  • Oaxaca: error with large sets of categorical variables

    Dear all,

    I am performing a Oaxaca decomposition with several sets of dummy variables, and the command works fine. But when I include an additional set of dummys, for 13 metropolitan areas, I get an error message:

    _error(): 3300 argument out of range
    oaxaca_normalize(): - function returned error
    <istmt>: - function returned error

    Nevertheless, when I reduce the number of metro areas to a smaller group, say 5 metro areas, and I build the dummys again, and run the Oaxaca command everything works fine again. So, the problem seems to be the number of metro areas for which I build the dummys. In 2013 I found the same question in the forum but no response was given. I appreciate any clue about how to solve the problem. Many thanks in advance.

    All the best,
    Javier
    Last edited by Javier Perez; 09 Dec 2016, 15:50.

  • #2
    Just a guess, but what are your dummy variable names? If they are long, try short names like "d1,d2,...,d13" and see if that helps.

    Comment


    • #3
      Hi Andrew, thanks a lot for your interest. I followed your advice, naming the dummys for the metro areas a1 to a13, and I now get the following error message:

      oaxaca_normalize(): 3498 inconsistent dummy set: a1 a2 a3 a4 a5 a6 a7 a8 a9
      <istmt>: - function returned error

      The command I'm using is the following:

      oaxaca l_inglabo_cons2008 s x x_2 ano2-ano7 est_civ2-est_civ5 tipocup2-tipocup4 a2-a13 jefe2 [fw=round(fex_c/12)] if ((rama4d=="5511" | rama4d=="5513" & d_informales_dane==1)),

      by(d_genero) cluster(area) detail pooled categorical(ano?, est_civ?, tipocup?, a?, jefe?) noisily relax


      Any other idea about the possible mistake I'm making? Many thanks!!!



      Comment


      • #4
        Hello Statalist,

        My reply is too late to help the original poster. But I hope it can help people who have the same problem.

        This issue, I believe, is due to missing values in explanatory categorical variables.

        The problem can be solved by removing observations with missing values in explanatory categorical variables before oaxaca.


        Code:
        keep if !missing(varlist)
        If the error still came back, please check if your oaxaca is up to date.

        Regards,
        Min
        Last edited by Min Zhang; 22 Jul 2017, 13:52.

        Comment


        • #5
          Hi! I know that this is an old post, but I have the same problem and I do not solve by using
          keep if !missing(varlist) I also checked and Stata tells there are no updates for the oaxaca package.. could someone please help me? Thanks a lot!!

          Comment


          • #6
            Hi, everyone!

            This topic is old, but since nobody posted a solution, I do it.

            If the number of "a" dummies is 10 or more, you need to write "categorical (a? a??)". So,it is not enough to write just "a?". If you have 100 or more dummies, you need to write (a? a?? a???), and so forth.

            Best wishes,
            Aleksey

            Comment


            • #7
              Hi everyone,

              This topic is old, but in case someone is still wondering, this worked for me:

              You need to split the dummies in different normalize() functions AND include dummies for all categories of the variables (even the omitted ones). For example:

              xi i.male i.educ, noomit

              oaxaca lnwage exp age normalize(_Imale0 _Imale1) normalize(_Ieduc1 _Ieduc2 _Ieduc3), by(migrant)

              Best wishes,
              César

              Comment

              Working...
              X