Announcement

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

  • Problem with konfound command to get the ITCV

    I want to examine the impact of unobservable confounding variables on my regression results.
    As such, I use the command konfound and I manage to get the RIR output but not the ITCV.

    Ma dataset consists in observations at the loan level and looks like:

    unique_key AllInSpreadDrawnbps IG rel_withoneleadmin_5y IG_relwithoneleadmin5y etc.
    17931 275.00 0 1 0
    57707 100.00 1 0 0
    28179 75.00 1 1 1
    24660 425.00 0 1 0
    1887 250.00 0 1 0
    128593 500.00 0 1 0
    160148 600.00 0 1 0
    15129 375.00 0 0 0

    My regression model is the following:
    reg AllInSpreadDrawnbps IG_relwithoneleadmin5y rel_withoneleadmin_5y IG lnamt log_mat_month d_collateral rev term spec_obj club_deal synd_size i.ctry i.sic1 i.year, robust

    Then I enter the following command:
    konfound IG_relwithoneleadmin5y, sig(0.05)

    And I get the following output (as well as the graph with the threshold and the estimate not reported below):
    __________________________________________________ __________________________________________________ _________
    Linear regression Number of obs = 24,518
    F(103, 24412) = .
    Prob > F = .
    R-squared = 0.5274
    Root MSE = 125.31

    ----------------------------------------------------------------------------------------
    | Robust
    AllInSpreadDrawnbps | Coefficient std. err. t P>|t| [95% conf. interval]
    -----------------------+----------------------------------------------------------------
    IG_relwithoneleadmin5y | 45.5331 3.16541 14.38 0.000 39.3287 51.73749
    rel_withoneleadmin_5y | -41.5446 2.48028 -16.75 0.000 -46.4061 -36.6831
    IG | -134.8248 3.59735 -37.48 0.000 -141.8758 -127.7738
    lnamt | -18.55069 .8089811 -22.93 0.000 -20.13634 -16.96503
    log_mat_month | 14.07543 2.545693 5.53 0.000 9.085714 19.06514
    d_collateral | 34.99248 2.673828 13.09 0.000 29.75161 40.23334
    rev | -55.28328 4.106865 -13.46 0.000 -63.33298 -47.23357
    term | 24.9439 4.58205 5.44 0.000 15.96281 33.925
    spec_obj | 36.14087 1.863601 19.39 0.000 32.4881 39.79364
    club_deal | -25.94557 3.981516 -6.52 0.000 -33.74959 -18.14156
    synd_size | -39.56289 1.27087 -31.13 0.000 -42.05387 -37.07191
    ...
    ctry FE
    ...
    sic1 FE
    ...
    year FE
    ...
    _cons | 408.7034 32.90041 12.42 0.000 344.2166 473.1903
    ----------------------------------------------------------------------------------------

    The default framework for the konfound command is now RIR (Robustness of
    Inference to Replacement). To generate ITCV, enter: konfound ind_var, indx(IT)
    where ind_var is the focal predictor.

    For variable IG_relwithoneleadmin5y

    Robustness of Inference to Replacement (RIR)

    RIR = 21176

    To nullify the inference of an effect using the threshold of 6.204 for
    statistical significance (with null hypothesis = 0 and alpha = .05), 86.37%
    of the (45.533) estimate would have to be due to bias. This implies that to
    nullify the inference one would expect to have to replace 21176 (86.37%)
    observations with data points for which the effect is 0 (RIR = 21176).
    _IG_relwithoneleadmin5yuncond_rycv invalid name
    r(198);

    end of do-file

    r(198);
    __________________________________________________ __________________________________________________ ________

    To solve the problem, I have tried alternative commands as below:
    konfound IG_relwithoneleadmin5y, indx("IT")
    konfound IG_relwithoneleadmin5y, indx(IT)
    konfound IG_relwithoneleadmin5y, indx("IT") uncond(0)


    I have also tried to change the name of my variable to remove "_" hence running the model with IGrelwithoneleadmin5y.

    I always get the same error message and no information on the ITCV parameter.

    For information, I am using StataSE 17.0.

    Thank you in advance for your help!

  • #2
    I don't use the command konfound (from SSC), but I think I can spot the problem. Stata variable names cannot exceed 32 characters. See

    Code:
    help limits
    It appears that the command creates an internal variable by adding a suffix "uncond_rycv" to the variable name. This suffix is 11 characters long, so that means that your variable name cannot exceed 32-11 = 21 characters. The variable "_IG_relwithoneleadmin5y" is 22 characters long.

    Code:
    di length("IG_relwithoneleadmin5y")
    Res.:

    Code:
    . di length("IG_relwithoneleadmin5y")
    22
    So rename variables that are longer than 21 characters in length, e.g.,

    Code:
    rename IG_relwithoneleadmin5y IG_relw1leadmin5y

    Comment


    • #3
      Thank you very much Andrew, shortening variable names has solved the problem and I manage to get both the RIR and the ITCV with the konfound command!

      Comment

      Working...
      X