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

st: Filling upper triangle of a symetric matrix


From   "Ronnie Babigumira" <[email protected]>
To   "Statalist" <[email protected]>
Subject   st: Filling upper triangle of a symetric matrix
Date   Wed, 26 Mar 2003 16:43:00 +0100

Dear listers
(Stata 8, win 2K) I have a correlation matrix in excel (I dont have the data
from which it was obtained) and I would like to perform factor analysis on
this matrix. This is possible if by using corr2data, I generate the
underlying data and then I can perform the factor analysis.

Here is my correlation matrix
Corr Matrix
1
0.439	1
0.41	0.351	1
0.288	0.354	0.164	1
0.329	0.32	0.19	0.595	1
0.248	0.329	0.181	0.47	0.464	1

If I try to read this in stata (using insheet), I get 6 new variables with
missing cases

  +---------------------------------------+
  |   v1     v2     v3     v4     v5   v6 |
  |---------------------------------------|
  |    1      .      .      .      .    . |
  | .439      1      .      .      .    . |
  |  .41   .351      1      .      .    . |
  | .288   .354   .164      1      .    . |
  | .329    .32    .19   .595      1    . |
  |---------------------------------------|
  | .248   .329   .181    .47   .464    1 |
  +---------------------------------------+
I then convert this into a matrix using mkmat and I get

a[6,6]
          1          .          .          .          .          .
  .43900001          1          .          .          .          .
        .41  .35100001          1          .          .          .
  .28799999       .354       .164          1          .          .
       .329  .31999999        .19  .59500003          1          .
       .248       .329  .18099999        .47  .46399999          1

Question. How can I tell stata that this is a symetric matrix and fill in
the missing ijs with the corresponding ji values? (or, how can I do this in
excel)

Ronnie


*
*   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