Announcement

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

  • How are augmented component-plus-residuals calculated?

    Can someone give an explanation, preferably by illustrating the underlying calculation using basic Stata commands, as to how augmented component-plus-residuals are calculated? I do apologize for asking such a basic question, but the documentation for this command links to a paywalled paper, and I've surprisingly not been able to find any other resources explaining how the calculation. I know regular component-plus-residuals can be replicated by:


    regress outcome predictor1 predictor2
    predict residuals, residuals
    gen adjusted_residuals = residuals + (predictor1* coefficient_predictor1)
    scatter adjusted_residuals predictor1

    How are the augmented component-plus-residuals calculated?


    Thanks in advance.

  • #2
    The paper may be accessible to you if you have JSTOR access at https://www.jstor.org/stable/1268980

    Comment


    • #3
      I do not have JSTOR access unfortunately. I've been trying to find a version of the paper without any luck.

      Comment


      • #4
        Understood. At this point I can only suggest

        Code:
        viewsource acprplot.ado

        Comment


        • #5
          Thank you. That is helpful. I will see if I can sort it out.

          Comment


          • #6
            FWIW, I like what Stata calls added-variable plots which seem to be siblings. My variants on the official commands were distributed through

            https://journals.sagepub.com/doi/pdf...6867X231162008

            For a clickable link

            Code:
            . search gr0009_2, entry
            
            Search of official help files, FAQs, Examples, and Stata Journals
            
            SJ-23-1 gr0009_2  . . . .  Software update for model diagnostic graph commands
                    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N. J. Cox
                    (help anovaplot, indexplot, modeldiag, ofrtplot, ovfplot,
                    qfrplot, racplot, rdplot, regplot, rhetplot, rvfplot2,
                    rvlrplot, rvpplot2 if installed)
                    Q1/23   SJ 23(1):298--299
                    various major and minor updates have been made to the
                    command and documentation

            Comment


            • #7
              I'll have to look at your versions of these commands. I am a fan of avplots but am currently trying to ascertain whether power transformations of some of my predictors may be appropriate, and my understanding is acprplots are ideal for this. I was able to sort out how it works based on the viewsource ado file. (This is a very useful feature of Stata I was not aware of).

              Rough code example:

              gen predictor2sq = predictor2 ^2

              regress DV predictor1 predictor2 predictor2sq
              predict residuals, residuals
              gen adjusted_residuals = residuals + (predictor2 * coefficient of predictor2) + (predictor2sq * coefficient of predictor2sq)
              scatter adjusted_residuals GPA

              It's not immediately intuitive to me what the advantage is of adding in the prediction from the squared variable if we are trying to ascertain whether the relationship is linear in the base model without the squared term, but I'm sure there's solid reasoning behind it.

              Bonus question if anyone has time: after determining that a square transformation of a predictor is needed, would an acprplot of that squared predictor itself be an appropriate tool (among others of course) for ascertaining whether the transformation successfully linearizes the relationship?




              Comment


              • #8
                And to be clear the code example I gave above produces the same plot as

                reg DV predictor1 predictor2
                acprplot predictor2

                Comment

                Working...
                X