Announcement

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

  • teffects: observations have no propensity-score matches within caliper

    Hi everyone,

    I am currently working on a project where I want to use STATA command teffects rather than psmatch2 (according to https://www.ssc.wisc.edu/sscc/pubs/stata_psmatch.htm). So far psmatch2 worked without any problems in my sample, but when I try to use teffects I have some trouble to get it going.

    I have in total ~70.000 firm observations, which I want to match based on 3 criteria (that is return-on-assets, leverage and firm size). My treatment dummy is coded binary (1 for treated observations and 0 for control observations). My dependent variable is bid-ask-spread. The code line for that looks as follows:

    Code:
    teffects psmatch (basmed_ln) (treat roa lntasset leverage), caliper(0.01) osample(nomatch) nneighbor(1)
    However when I try to run this in my do-file I always get
    26 observations have no propensity-score matches within
    caliper .01; they are identified in the osample() variable
    I had a look at the data editor and could see that 26 observations had indeed no propensity score.
    Next, I wanted to drop those obs where
    Code:
    osample == "."
    To do this is used the suggestion by Jonathan Seiden: https://www.statalist.org/forums/for...ffects-nnmatch

    So I adjusted my code to :
    Code:
    logit treat_hard (roa lntasset leverage)  
    predict ps  
    teffects psmatch (basmed_ln) (ps), caliper(0.01) nneighbor(1) osample(outofrange) vce(robust)  
    drop if outofrange == 1    
    teffects psmatch (basmed_ln) (treat_hard ps), caliper(0.01) nneighbor(1) vce(robust)
    When I ran this, I get the following error:
    treatment variable ps must contain nonnegative integers
    .

    This is not obvious to me as
    Code:
    ps
    does not have any nonnegative values (it is within a range of 0 and 1).

    I tried using
    Code:
    drop if ps =="."
    , as I have 288 missing values generated but it didn't do the job...

    Anyone an idea what I am missing to get teffects working?

    P.S. I am using STATA 14.2

  • #2
    Welcome to the Stata Forum / Statalist,

    Unfortunately, I cannot see any reason for that message, apart from "ps" having negative numbers. Surely you have typed - summarize ps - and checked it If not, you may type - drop if ps < 0.

    That being said, excluding "." values couldn't fix the issue, since "." is considered a "very large", sort of infinite "positive" number.
    Best regards,

    Marcos

    Comment


    • #3
      Hi Marcos,

      thanks for your quick reply. Yes I checked whether ps is indeed negative, but after having a look in the data editor (and sorting ps) I can see that it ranges from 0,03 to 0,99 (except having some missing values). I tried to exclude missing values by:
      Code:
      predict ps
      drop if ps<0
      but I still get the same error message telling me:
      treatment variable ps must contain nonnegative integers
      ...

      Comment


      • #4
        The problem is not in "nonnegative", it is in "integers".
        Code:
        teffects psmatch (basmed_ln) (ps), caliper(0.01) nneighbor(1) osample(outofrange) vce(robust)
        returns an error because Stata interprets ps as the treatment variable.
        Code:
        teffects psmatch (basmed_ln) (treat_hard ps), caliper(0.01) nneighbor(1) vce(robust)
        should work.
        Last edited by Braulio Santos; 08 Feb 2019, 05:50.

        Comment


        • #5
          Hi Braulio,

          thanks for your reply. I tried your suggestion and it did work, however I ran into another error which statest:
          "observation has fewer than 2 propensity-score matches within caliper .01 when in-group clustering for the robust() option;"
          . I tried to run the code without robust SE clustering but still get the same error message. Any idea what triggers this error?

          Comment


          • #6
            Sorry for the late reply.
            I tried your suggestion and it did work
            It was not literally a suggestion. I simply pointed out that you tried to reproduce syntactically invalid code. Jonathan Seiden forgot to type the treatment variable in
            Code:
            teffects psmatch (outcomevar) (ps), caliper(0.05) osample(outofrange) vce(robust)
            What he intended was
            Code:
            teffects psmatch (outcomevar) (treat ps), caliper(0.05) osample(outofrange) vce(robust)
            I tried to run the code without robust SE clustering but still get the same error message
            You didn't show your code, but if it was
            Code:
            teffects psmatch (basmed_ln) (treat_hard ps), caliper(0.01) nneighbor(1)
            it is exactly the same as
            Code:
            teffects psmatch (basmed_ln) (treat_hard ps), caliper(0.01) nneighbor(1) vce(robust)
            because -vce(robust, nn(2))- is the default.

            It is difficult to give sound advice without substantive knowledge of the research question and a full picture of the model. You only showed us individual lines of code and excerpts of error messages.
            I will assume that your causal model satisfies SUTVA and ignorability, the logistic model was correctly specified and your propensity score has adequate common support area and balancing properties (if not, any further consideration is futile), The first thing that comes to mind is why did you choose such a narrow caliper width? What is the standard deviation of the propensity score?
            Last edited by Braulio Santos; 14 Feb 2019, 08:52.

            Comment

            Working...
            X