No BSD License  

Highlights from
save4spss

1.0

1.0 | 1 rating Rate this file 15 Downloads (last 30 days) File Size: 5.91 KB File ID: #8659
image thumbnail

save4spss

by

 

06 Oct 2005 (Updated )

saves numerical matrices as ASCII data + SPSS import syntax

| Watch this File

File Information
Description

save4spss()opens dialogue boxes to select a matrix,a cell array with variable names (optional),and specify a file name to save the matrix the SPSS syntax gets the same name.

save4spss(DATA,VARNAMES,FILE) saves the matrix DATA in the file given in FILE and creates a SPSS syntax file FILE.sps to import these data in SPSS .Variables (data columns) are named according to the elements of cell array VARNAMES.
After running save4spss, just open the generated SPSS syntax in SPSS and run it. Also see help save4spss

example:
mystudy=[1 30 10000; 2 35 15000];
varnames={'subject';'age';'income'}
save4spss(mystudy,varnames,'mystudy.dat')
creates an ASCII file mystudy.dat and a SPSS syntax mystudy.sps.

If you run this syntax in SPSS the data are imported, the variables named and the file is saved as mystudy.sav

MATLAB release MATLAB 7.0.1 (R14SP1)
Other requirements this function was written for the German version of SPSS. If you have trouble with the decimal point/comma, play around with the import formats of SPSS and change the formatting commands that save4spss() writes in the syntax file.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
14 Dec 2011 Casper

Does not work for large datasets.

13 Feb 2010 Daniel Goerke

I'm wondering about this error message when executing the sav skript in SPSS:

>Fehler Nr. 105. Befehlsname: SAVE
>Dieser Befehl ist nicht gültig, bevor eine Arbeitsdatei definiert wurde.
>Dieser Befehl wird nicht ausgeführt.
/COMPRESSED

in english:
>Error # 105. Command name: SAVE
>This command is not valid before a working file has been defined.
>Execution of this command stops.
/COMPRESSED.

I'm using PASW Statistics 18 and Matlab R2009b.
I edited the sav skript generated by save4spss() by adding the file path. The new data set created by the sav skript is empty.
Any ideas?

Best regards,
Daniel

Updates
10 Oct 2005

summary sentence incomplete

Contact us