Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: mat procedure won't run in V9


From   "Garrard, Wendy M." <[email protected]>
To   <[email protected]>
Subject   st: mat procedure won't run in V9
Date   Sat, 10 Sep 2005 16:19:45 -0500

Hi all,
I am hoping someone can help me get this bit of code (developed in v.8)
to run in v9. 
The commands are below, and when it works properly, it calls a
"meta-regression" macro and produces a list (matrix) of bivariate
weighted random effects correlations between the effect size and each
variable in the varlist.

This is the first time I've tried to use this do-file in v9, and no
correlations are showing up in the (oblong) matrix.

Any suggestions?  Thanks very much 
--wg

*********************
/*START*/
mat res = J(20,2,0)
local i 0
foreach v of varlist   var1 var2 var3 var4 var5  {
	qui metaregW es_adjRndwz `v' [aw=weight] , model(ml)
	*summarize `v'
      local ++i
      mat res[`i',1] = r(corr)
      mat res[`i',2] = r(pr)
      local rl "`rl' `v'"
	          }
mat rownames res = `rl'
mat colnames res =  Corr(ml)  p-value
mat list res, f(%9.3f)
/*STOP*/


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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