Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: Predicting sdres in Stata

 From "Seed, Paul" To "statalist@hsphsun2.harvard.edu" Subject Re: st: Predicting sdres in Stata Date Thu, 21 Jul 2011 10:31:54 +0100

```Dear Statalist,
Using the regression, Lars can divide the
outcome var into two parts: the predicted part (due to BME)
and the residual, adjusted for BME, in which he is interested.

He needs to drop the robust VCE from the regression equation.
Then he can predict the residuals. As he is interested in the
estimates, not the SE, he loses nothing by this.

Incidentally, the reason his first attempt produced identical
results when using -swilk- and -qnorm-
is that the predicted values he was using are
a_1 + b_1*BSA
and
a_2 + b_2*BSA
These are linear transformations of BSA,
with identically shaped distributions, and correlations with
each other and BSA = 1.
Nothing of the dependent variables (depenVar1 and depenVar2)
is used.

***************************
regress depenVar1 BSA

predict sdres, resid
qnorm sdres
swilk sdres
drop sdres

regress depenVar2 BSA
predict sdres, resid
qnorm sdres
swilk sdres
**************************************

Paul T Seed, Senior Lecturer in Medical Statistics,
Division of Women's Health, King's College London and King's Health Partners
020 7188 3642.

On 7/20/11 8:05 AM, Lars Folkestad wrote:
> Hi Stata Listers
>
> This is probably a simple question for you all. I just cannot see my way
> through it.
>
> I am doing liniar regression for different variables as a way to adjust for
> Body Surface Area. I do the following
>
> . regress depenVar1 BSA, vce(robust)
> . predict sdres
> . qnorm sdres
> . swilk sdres
> . predict adjdepenVar1
> . drop sdres
>
> . regress depenVar2 BSA, vce(robust)
> . predict sdres
> . qnorm sdres
> . swilk sdres
>
> The two swilks tests give the exact same p-value and the qnorm graf is
> identical.
>
> I cannot understand how. For your information i am new to stata and
> regression and my statistically knowledge is low.
>
> Why is the two swilks tests and qnorms the same?
>
> lars

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```