Announcement

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

  • What's under the hood of _rmcoll?

    Hey everyone,
    To exclude/flag perfectly collinear covariates in regression commands, Stata uses _rmcoll. I was wondering, how exactly _rmcoll works under the hood. Does it work based on the calculation of variance inflation factors (VIF)? The documentation doesn't really say anything about the method. Also, I've failed to locate the corresponding .ado-file in my Stata folder.

    Thanks for any hints in advance!

    Best,
    Boris

  • #2
    You can find where something is stored by typing which _rmcoll . It will tell you that it is a build-in command, meaning there is no .ado file but part of the compiled C code we don't have access to.

    I doubt it is based on the VIF, as _rmcoll if about removing variables that are completely collinear, i.e. there is no way of estimating a model with all variables in them. VIFs are for partially collinear variables, i.e. the variables are correlated, but not perfectly correlated. I suspect that _rmcoll looks at the rank of the design matrix.
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Maarten, thanks for the pointer on the "which" command.
      You mention rank(X). The rank tell us that there is perfect multicollinarity if rank(X)<k, but the rank alone doesn't tell us anything about which variables to flag, since it's just a scalar number.

      Comment


      • #4
        Correct, but the solution is likely to be in that direction rather than VIFs. But we can only speculate, as there is no way for us to look at it.

        Maybe you can get a more productive response if you tell us why you want to know this?
        ---------------------------------
        Maarten L. Buis
        University of Konstanz
        Department of history and sociology
        box 40
        78457 Konstanz
        Germany
        http://www.maartenbuis.nl
        ---------------------------------

        Comment


        • #5
          Perhaps the question is what rule -_rmcoll- uses to choose which variable(s) to remove in the case colinearity is found. A little experimentation with it suggests that _rmcoll removes the first-mentioned variable(s) in the varlist that are part of the colinear relationship. But the manual documentation says nothing about this, so there is no guarantee that this is correct. The lack of documentation also means there is no guarantee that StataCorp won't change it in future versions.

          Comment

          Working...
          X