program mfracmiss, rclass
*! Version: March 29, 2007 @ 12:50:58
*! Author:  Mark Lunt
*! Date:    January 11, 2008 @ 15:08:35

version 9

	if "`e(MIM_cmd)'" == "" {
		noi di as error `"Previous command was not "mim""'
		exit 301
	}

	tempname r lambda
	matrix `r'      = e(MIM_r)
	matrix `lambda' = e(MIM_lambda)
	local  p        = colsof(e(MIM_B))
	local names : colnames(e(MIM_B))

  noi di as text "{hline 13}{c TT}{hline 54}"
	di as text "  Variable   {c |}{space 2}Increase in Variance"  ///
			"{space 8}Missing Information"
  noi di as text "{hline 13}{c +}{hline 54}"
	foreach i of numlist 1/`p' {
		local name : word `i' of `names'
		di as text %12s abbrev("`name'", 12) " {c |}" _cont
		di as result %19.4f el(`r',1,`i') _cont
		di as result %25.4f el(`lambda',1,`i')
	}
  noi di as text "{hline 13}{c BT}{hline 54}"

end