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

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

From |
John Antonakis <John.Antonakis@unil.ch> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: Calculate average elements matrix (below the diagonal ) |

Date |
Tue, 11 Sep 2012 11:51:25 +0200 |

That brilliant! Thanks. Nick. Best, J. __________________________________________ Prof. John Antonakis Faculty of Business and Economics Department of Organizational Behavior University of Lausanne Internef #618 CH-1015 Lausanne-Dorigny Switzerland Tel ++41 (0)21 692-3438 Fax ++41 (0)21 692-3305 http://www.hec.unil.ch/people/jantonakis Associate Editor The Leadership Quarterly __________________________________________ On 11.09.2012 11:28, Nick Cox wrote: > There are probably more elegant ways to do it, but this works: > > sysuse auto > corr price mpg rep78 > mata > C = st_matrix("r(C)") > mean(abs(select(vech(C), vech(C) :< 1))) > >

>

>> matrix. E.g., >> >> sysuse auto >> corr price mpg rep78 >> mat A = r(C) >> mat list A >> >> This returns the following three correlations below the diagonal: >> >> -.45594895 .00655327 .40234039 >> >> Specifically, I would like to: obtain the average absolute values of the >> below-diagonal elements: >> >> i.e., dis (abs(-.45594895) + abs(.00655327) + abs(.40234039))/3 > * > * 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/ * * 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/

**References**:**st: Re: Interpretation of the Coefficients obtained via -stcox-***From:*Yuval Arbel <yuval.arbel@gmail.com>

**Re: st: Re: Interpretation of the Coefficients obtained via -stcox-***From:*Yuval Arbel <yuval.arbel@gmail.com>

**Re: st: Re: Interpretation of the Coefficients obtained via -stcox-***From:*Steve Samuels <sjsamuels@gmail.com>

**Re: st: Re: Interpretation of the Coefficients obtained via -stcox-***From:*Yuval Arbel <yuval.arbel@gmail.com>

**st: Calculate average elements matrix (below the diagonal )***From:*John Antonakis <John.Antonakis@unil.ch>

**Re: st: Calculate average elements matrix (below the diagonal )***From:*Nick Cox <njcoxstata@gmail.com>

- Prev by Date:
**Re: st: Missing value problem with new variable** - Next by Date:
**Re: st: Parmest question** - Previous by thread:
**Re: st: Calculate average elements matrix (below the diagonal )** - Next by thread:
**st: SSC Activity, August 2012** - Index(es):