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]

st: stata 10 alternative to mibeta


From   Will Hauser <[email protected]>
To   [email protected]
Subject   st: stata 10 alternative to mibeta
Date   Fri, 05 Nov 2010 13:35:46 -0400

Hello listers,
Using stata 10 I have performed 100 imputations using the ICE command. I can obtain regression results with the mim or micombine command but neither affords betas. With the generous help of someone at the UCLA help group I've got a do file that's close but doesn't quite do it and I don't know enough to get it right.

The approach is to standardize all the variables then do each of the 100 regressions, save the coefficients, and then average them. If there's a flaw in this approach, or a better one, I'm open to your ideas.

Below is the do file. Any advice you can offer would be greatly appreciated.

Will


**M should be set to the number of imputations used to create the dataset
local M = 100
**this local identifies the independent variables used in the regression equation
local reglist = "x1 x2 x3 x4"

* number of predictors in regression equation
local p = 4

 mat beta = J(`M', `p', 0)
 *local M = 100 */edited out because I think it's unnecessary

 foreach i of numlist 1/`M' {
   preserve

   keep if _mj == `i'

   foreach var of varlist `reglist' {
      capture drop std_`var'
    egen zz_`var' = std(`var')
    }
    egen z_courtsfair = std(courtsfair)
    qui regress z_courtsfair zz_*
    mat b=e(b)
     foreach k of numlist 1/`p' {
      mat beta[`i', `k'] = el(b, 1, `k')
     }
  restore
}


svmat beta, names(var)




*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index