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]

st: Calculate average elements matrix (below the diagonal )

From   John Antonakis <>
Subject   st: Calculate average elements matrix (below the diagonal )
Date   Tue, 11 Sep 2012 10:34:19 +0200


I would like to calculate the average absolute correlations of a correlation 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



Prof. John Antonakis
Faculty of Business and Economics
Department of Organizational Behavior
University of Lausanne
Internef #618
CH-1015 Lausanne-Dorigny
Tel ++41 (0)21 692-3438
Fax ++41 (0)21 692-3305

Associate Editor
The Leadership Quarterly
*   For searches and help try:

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