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, is already up and running.

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

Re: st: Beta coefficients for GLM models?

From   Maarten Buis <>
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 <>)

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

// 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 L. Buis
Reichpietschufer 50
10785 Berlin
*   For searches and help try:

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