Announcement

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

  • Counterfactual decomposition in Stata

    I am trying to analyse the change in wage differentials between men and women in the Netherlands, using OSA 1990 and 2010.
    Based on the model proposed by Chernozhukov, V., I. Fernández-Val, and B. Melly (2013), I want to do a counterfactual analysis based on a distribution regression.
    I converted the variables gender (female=1), marital status(married or living together =1), country of origin (dutch = 1), education (high education=1) and age (older than 38=1) into dummy variables.
    However, when executing the counterfactual command in Stata 17 as follows:
    counterfactual log_income marital origin education old group(gen) method(logit)
    I get the following error:
    factor-variable and time-series operators not allowed (101)

    Can somebody help me solving this problem or proposing a different approach?

    Thanks in advance!

    Last edited by Maud Wester; 27 Oct 2021, 07:56.

  • #2
    use a comma before the options,
    Code:
    counterfactual log_income marital origin education old, group(gen) method(logit)

    Comment


    • #3
      The counterfactual command is apparently a community contributed Stata command, rather than part of base Stata.

      The paper you cite is behind a paywall. For those lacking access, the authors also gave a presentation to the 2016 Swiss Stata Users Group Meeting in Bern

      https://www.stata.com/meeting/switze...tzerland16.pdf

      which explains their methodology and demonstrates the use of the cdeco and counterfactual commands, but unfortunately does not give a source from which the commands can be downloaded.

      Further searching of the web finds a Google site for the author Blaise Melly on which at

      https://sites.google.com/site/blaise...-distributions

      the commands are described and installation instructions are given.

      If the command you ran was
      Code:
      counterfactual log_income marital origin education old group(gen) method(logit)
      then you neglected the comma that must separate the variable list from the options. From the output of help counterfactual we see
      Code:
      Syntax
      
             counterfactual depvar indepvars [if] [in] [weight] [, options]
      which tells us that if any options are to be provided, the must be preceded by a comma. When I ran one of the author's examples given in the help output and omitted the comma, I got the same unhelpful error message you did.

      Comment


      • #4
        Thank you both so much!

        Comment


        • #5
          I am doing the decomposition of wages difference using cdeco. How do I get the results of decomposition for all independent variables not only the total difference, explained and explained? I want also to identify the contributing factor along the distribution.

          Comment

          Working...
          X