Google Answers Logo
View Question
 
Q: Saving a covariance matrix to a file using SPSS ( Answered 5 out of 5 stars,   0 Comments )
Question  
Subject: Saving a covariance matrix to a file using SPSS
Category: Reference, Education and News > Teaching and Research
Asked by: maxb_max-ga
List Price: $15.00
Posted: 28 Sep 2004 13:01 PDT
Expires: 28 Oct 2004 13:01 PDT
Question ID: 407564
Hi

I have to generate a covariance matrix from a data set for input to
another statistical program (LISREL). How does arrange for SPSS to
output this covariance matrix to a file?

Thanks

Max
Answer  
Subject: Re: Saving a covariance matrix to a file using SPSS
Answered By: larre-ga on 28 Sep 2004 14:16 PDT
Rated:5 out of 5 stars
 
Try:

CORRELATIONS varlist
 /MATRIX=OUT(*).
MCONVERT.
SELECT IF ROWTYPE_='COV'.
SAVE OUTFILE=filename /DROP=ROWTYPE_ VARNAME.                                   

Where, 'varlist' is the names of variables and 'filename' is the name
of the file which will hold the covariance matrix.


How to Create a File with a Covariance Matrix
http://www.asu.edu/it/fyi/dst/helpdocs/statistics/spss/tips/cov_matrix.html


The most current version of LISREL (v.8.54--05/2003) uses the Import
Data in Free Format option in order to:

Read comma separated files (.csv) 
Read Tab-delimited files (.txt) 
Read SPSS for Windows (.sav) files 

LISREL Upgrade Patches are available at:
http://www.ssicentral.com/other/lispatch.htm




Alternative Methods
-------------------

Export Co-Variance Matrix to ASCII
http://pages.infinit.net/rlevesqu/Syntax/Matrix/ExportVarianceCovarMatrixToASCIIfile.txt

Export CoVariance Matrix to Save File
http://pages.infinit.net/rlevesqu/Syntax/Matrix/ExportVarianceCovarMatrixToSavFile.txt

MACRO To Export Covariance Matrix of Variables to Text File
http://www2.jura.uni-hamburg.de/instkrim/kriminologie/Mitarbeiter/Enzmann/Software/covmat.sps


I hope this helps. 

---l

Request for Answer Clarification by maxb_max-ga on 29 Sep 2004 01:10 PDT
As a matter of interest, would there have been a way of achieving this
without using SPSS syntax e.g. from the menu, or using an SPSS output
file?

Kind regards

Max

Clarification of Answer by larre-ga on 29 Sep 2004 08:41 PDT
If so, I'm not familiar it. I'm pretty sure a custom application could
be written to convert between the formats, but several additional
searches didn't manage to locate a universal independent conversion
utility.

----------------------------------------------------------------------


You're quite welcome. My thanks to you for the kind words, rating and
tip. Glad to be of service.  ---l
maxb_max-ga rated this answer:5 out of 5 stars and gave an additional tip of: $5.00
What can I say - this is the perfect answer, complete with macro
example. Truely, I searched Google for days to find this - worth every
penny (or cent depending where you live!)

Many, many thanks.

Max

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy