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


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

st: AW: Import external correlation matrix


From   Dirk Enzmann <dirk.enzmann@uni-hamburg.de>
To   statalist@hsphsun2.harvard.edu
Subject   st: AW: Import external correlation matrix
Date   Mon, 14 Jun 2010 12:54:08 +0200

Thanks Martin for you quick and helpful answer!

In case that others will encounter the same problem, here an example on how to use an external correlation matrix for factor analysis. I use -insheet-, -mkmat-, and -matname-. Note that you have to set the numbers of observations also via -set obs-, otherwise -fapara- will yield wrong results:

* ------------------------------------------------

* (hopefully this line will not get broken in the email):
global URL1 "http://www2.jura.uni-hamburg.de/instkrim/kriminologie/Mitarbeiter/Enzmann/Lehre/StatIIKrim/Factor/";

* Install -fapara- if necessary:
cap which fapara
if _rc {
net install fapara, from("http://www.ats.ucla.edu/stat/stata/ado/analysis";)
}

* Install -sortl- if necessary:
cap which sortl
if _rc {
  ssc install sortl
}

* Use correlation matrix published in Harman (1976, p. 124)
* Harman, H.H. (1976) Modern Factor Analysis. Chicago, IL (3rd ed.):
*   University of Chicago Press.

insheet using "${URL1}holzingr.cor", clear

mkmat v1-v24, matrix(holzinger)
matname holzinger visual   cubes    paper    flags   general  ///
                  paragrap sentence wordc    wordm   addition ///
                  code     counting straight wordr   numberr  ///
                  figurer  object   numberf  figurew deduct   ///
                  numeric  problemr series   arithmet, explicit
set obs 145

factormat holzinger, n(145) factors(4)
fapara, reps(10000)  // Please wait - it will take some time!
rotate, quartimin oblique
sortl
matlist e(r_Phi), format(%7.4f) title("Factor correlation matrix")

* ------------------------------------------------

Dirk

From: "Martin Weiss" <martin.weiss1@gmx.de>
Subject: st: AW: Import external correlation matrix

<>
Just -insheet- the thing and subsequently -mkmat-.



HTH
Martin

--------------------------------
Dirk Enzmann
Institute of Criminal Sciences
Dept. of Criminology
Rothenbaumchaussee 33
D-20148 Hamburg, Germany
http://www2.jura.uni-hamburg.de/instkrim/kriminologie/Mitarbeiter/Enzmann/Enzmann.html


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