Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Beta coefficients are not equal to coefficients on standardized variables?


From   "Roberto Liebscher" <roberto.liebscher@ku-eichstaett.de>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Beta coefficients are not equal to coefficients on standardized variables?
Date   Sat, 16 Jun 2012 16:10:28 +0200 (CEST)

Thanks at all for the clarification.

Roberto

>> On Fri, Jun 15, 2012 at 5:22 PM, Roberto Liebscher wrote:
>> There is one thing that makes me puzzling about the - beta - option in
>> regression commands. In a simple example using the lifeexp dataset I first
>> used the built-in function - beta - :
<snip>
>> Then I standardized the variables by hand and re-ran the regression
with the
>> new variables:
<snip>
>> Now the coefficients are slightly different. For example the
coefficient on
>> gnppc_std is 0.6608475 whereas it has been 0.6506803 in the first
>> calculation.
>> Is this caused by rounding errors? Or is there any other explanation for
>> this?

> The main reason is that you standardized within the wrong sample. The
> -beta- option will standardize within the sample used by -regress-,
> i.e. ignore all observations where at least one variable contained a
> missing value. You standardized within the entire dataset. After that
> there is still a little difference, which you can take away by
> creating the standardized variables as -double-.
>
> *---------------- begin example ------------------
> sysuse lifeexp, clear
> regress lexp gnppc popgrowth, beta
>
> // standardize in the false sample
> egen popgrowth_std_fs = std(popgrowth)
> egen lexp_std_fs = std(lexp)
> egen gnppc_std_fs = std(gnppc)
> regress lexp_std_fs gnppc_std_fs popgrowth_std_fs
>
> // get the right sample
> gen byte touse = !missing(popgrowth,lexp,gnppc)
> egen popgrowth_std = std(popgrowth) if touse
> egen lexp_std = std(lexp) if touse
> egen gnppc_std = std(gnppc) if touse
> regress lexp_std gnppc_std popgrowth_std
>
> // extra precision
> egen double popgrowth_std_d = std(popgrowth) if touse
> egen double lexp_std_d = std(lexp) if touse
> egen double gnppc_std_d = std(gnppc) if touse
> regress lexp_std_d gnppc_std_d popgrowth_std_d
> *----------------------- end example --------------------
> (For more on examples I sent to the Statalist see:
> http://www.maartenbuis.nl/example_faq )
>
> Hope this helps,
> Maarten
>
> --------------------------
> Maarten L. Buis
> Institut fuer Soziologie
> Universitaet Tuebingen
> Wilhelmstrasse 36
> 72074 Tuebingen
> Germany
>
>
> http://www.maartenbuis.nl
> --------------------------

*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index