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

From |
"Martin Weiss" <martin.weiss1@gmx.de> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
Re: st: AW: can I get standardized coefficients by standardize variables first? |

Date |
Tue, 3 Mar 2009 20:54:56 +0100 |

<> Mandy,

********** clear* set mem 400m * enter the percentage of missings here loc mis 0.01 u http://www.stata-press.com/data/imeus/traffic, clear foreach var of varlist fatal beertax spircons unrate perincK { replace `var'=. if runiform()<`mis' } qui ds, not(type string) foreach var of varlist `r(varlist)'{ egen std`var'=std(`var') } xi: reg fatal beertax spircons unrate perincK i.state, beta xtreg stdfatal stdbeertax stdspircons stdunrate stdperincK, fe ********** HTH Martin _______________________

To: <statalist@hsphsun2.harvard.edu> Sent: Tuesday, March 03, 2009 8:22 PM

Dear Mr. Weiss, Thanks for your reply! You are right---it should be -foreach-- rather than --local--. What I meant and actually used is using --foreach--to standardize all the variables. I don't know why I wrote into -local--. Thanks! I think I kind of find why the results given by the two methods are different. It maybe is due to missing values. That is, for some groups , there are missing values for some years and for some indepent variables. ------------------------------ group year y var1 var2 var 3 var4 1 1981 1 1 missing 0 1 1 1982 1 1983 2 1981 2 1982 3 1981 3 1982 3 1983 ------------------------------------ For the first observation, it's included in the way "standardizing varaibles first" because y , var1,var3-4 included this observation. But it's excluded from the way "using beta option directly". So, can I underdtand that it is an alternative way to get beta coefficents by standardized variables first and then use the regular commands? This is the question I'm interested in. Thanks a lot! Mandy * * 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/

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

**Follow-Ups**:**Re: st: AW: can I get standardized coefficients by standardize variables first?***From:*Mandy fu <mandy.fu1@gmail.com>

**Re: st: AW: can I get standardized coefficients by standardize variables first?***From:*Eva Poen <eva.poen@gmail.com>

**References**:**st: can I get standardized coefficients by standardize variables first?***From:*Mandy fu <mandy.fu1@gmail.com>

**Re: st: AW: can I get standardized coefficients by standardize variables first?***From:*Mandy fu <mandy.fu1@gmail.com>

- Prev by Date:
**RE: st: Re: Extract information from a string variable** - Next by Date:
**st: Re: interpreting standardized coefficients in multiple regressions with product terms** - Previous by thread:
**Re: st: AW: can I get standardized coefficients by standardize variables first?** - Next by thread:
**Re: st: AW: can I get standardized coefficients by standardize variables first?** - Index(es):

© Copyright 1996–2015 StataCorp LP | Terms of use | Privacy | Contact us | What's new | Site index |