Bookmark and Share

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


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

Re: st: Beta coefficients for GLM models?


From   Maarten Buis <[email protected]>
To   [email protected]
Subject   Re: st: Beta coefficients for GLM models?
Date   Wed, 21 Nov 2012 11:14:29 +0100

On Tue, Nov 20, 2012 at 10:59 PM, Scott Holupka wrote:
> I'm currently using GLM (Stata 12) to analyze some expenditure data and I
> would like to compare the effects of different coefficients in the model.
> If this were an OLS I would look at the beta coefficients, but I can't
> figure how to compute a beta or beta-like coefficient for a GLM model.

Beta coefficients standardize both the
dependent/explained/left-hand-side/y variable and the
independent/explanatory/right-hand-side/x-variables. This is a bit
overkill if all you want is to compare coefficients in the same model.
In that case it is enough that the scale of the independent variables
you want to compare have a comparable scale. For continuous variables
this is often done by standardizing it, i.e. subtract the mean and
divide by the standard deviation. This assumes that a standard
deviation change in one variable is comparable to a standard deviation
in another variable, which is not always true. Moreover, this
standardization is only necessary if the variables whose effect you
want to compare have different units, e.g. if both are measured in
some (the same) currency you should not standardize; standardizing
would in that case only lead to a loss of interpretability without any
gain. If you have a categorical variable than that becomes a bit more
of a challenge. In that case you can use sheaf coefficients (-ssc desc
sheafcoef- and <http://www.maartenbuis.nl/wp/prop.html>)

*-------------------------- begin example ------------------------
// data preparation
sysuse nlsw88, clear
gen byte lower = inlist(occupation, 9, 10, 11, 12, 13) ///
    if occupation < .
gen byte middle = inlist(occupation, 3, 4, 5, 6, 7, 8) ///
    if occupation < .

// standardize grade and ttl_exp	
sum grade if !missing(occupation,married, never_married, ///
                      grade, ttl_exp, wage)
gen z_grade = ( grade - r(mean) ) / r(sd)

sum ttl_exp if !missing(occupation,married, never_married, ///
                        grade, ttl_exp, wage)
gen z_ttl_exp = ( ttl_exp - r(mean) ) / r(sd)

// estimate model
glm wage lower middle married never_married z_grade z_ttl_exp, ///
    link(log)

// compute sheaf coefficients for class and marital status
sheafcoef, latent(class:   lower middle;          ///
                  marital: married never_married) ///
           post eform

// class, and z_ttl_exp seem to have similar effects
// but we can test whether the effects are the same
test class_e = z_ttl_exp_e
*--------------------------- end example -------------------------

Hope this helps,
Maarten

---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany

http://www.maartenbuis.nl
---------------------------------
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index