Discussion:
Need Help: How To Combine Data
(too old to reply)
zamdlr
2012-06-26 02:02:11 UTC
Permalink
John Darrington
2012-06-26 16:54:05 UTC
Permalink
1970-01-01 00:00:00 UTC
Permalink
On Mon, Jun 25, 2012 at 07:02:11PM -0700, zamdlr wrote:

Hi, first of all, sorry if this question has been asked before. I'm new to
PSPP and have minimal knowledge of it. My questions is, I have 3 files,
named as, pdt.sav, pst.sav & akaun.sav. All the files have the same
variables. The data in this files had being entered by 3 different peoples.
And now, i'm suppose to combine this 3 files to be 1 file before performing
analysis. Anybody can guide me on how to combine this files? All help are
very much appreciate. Thanks.

See the chapter in the manual entitled "Combining Data Files".

J'
--
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3
See http://keys.gnupg.net or any PGP keyserver for public key.
1970-01-01 00:00:00 UTC
Permalink
Thanks J'.
I found the syntax in manual as this:

Per input file:
/FILE={*,'file_name'}
[/RENAME=(src_names=target_names)...]
[/IN=var_name]
[/SORT]

Once per command:
/BY var_list[({D|A})] [var_list[({D|A}]]...
[/DROP=var_list]
[/KEEP=var_list]
[/FIRST=var_name]
[/LAST=var_name]
[/MAP]

Frankly there are a few instruction that i don't really understand but i
tried to do it by i. opening all 3 files ii. Open - New file -> Syntax, then
I put this command:

/FILE={*,'pdt.sav'}
[/RENAME=(old=new)...]
[/IN=var_name]
[/SORT]

/FILE={*,'pst.sav'}
[/RENAME=(old=new)...]
[/IN=var_name]
[/SORT]

/FILE={*,'akaun.sav'}
[/RENAME=(old=new)...]
[/IN=var_name]
[/SORT]

iii. and press Run.
I know this is wrong, but i don't know how to make it right. Could someone
please give me some advise? This is 3 files has the exact variables. Thank
you very much.
Post by
See the chapter in the manual entitled "Combining Data Files".
J'
--
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3
See http://keys.gnupg.net or any PGP keyserver for public key.
_______________________________________________
Pspp-users mailing list
https://lists.gnu.org/mailman/listinfo/pspp-users
--
View this message in context: http://old.nabble.com/Need-Help%3A-How-To-Combine-Data-From-3-Different-Files--tp34070199p34075917.html
Sent from the Gnu - PSPP - Users mailing list archive at Nabble.com.
zamdlr
2012-06-27 00:49:03 UTC
Permalink
1970-01-01 00:00:00 UTC
Permalink
You need to describe what you are trying to do.

For example, I had three different files containing the same variables
(on different samples). I had already created SPSS SAV files.

The follow code combined them into a single database:

ADD FILES
/FILE="G:\IIT\nsf_ethics_grant\analyses\2012-06\Ethics_Survey_STEM_participants.SAV"

/FILE='G:\IIT\nsf_ethics_grant\analyses\2012-06\Ethics_Survey_IIT_psychstudents.SAV'
/FILE='G:\IIT\nsf_ethics_grant\analyses\2012-06\Ethics_Survey_Mich_Tech_final.SAV'
.
EXECUTE.

In the code you refer to, the square brackets [] denote optional
commands and you would only use them if you knew what they do. And if
you did need those optional parts of the commands, you would NOT include
the square braces themselves.

-Alan
Post by
Thanks J'.
/FILE={*,'file_name'}
[/RENAME=(src_names=target_names)...]
[/IN=var_name]
[/SORT]
/BY var_list[({D|A})] [var_list[({D|A}]]...
[/DROP=var_list]
[/KEEP=var_list]
[/FIRST=var_name]
[/LAST=var_name]
[/MAP]
Frankly there are a few instruction that i don't really understand but i
tried to do it by i. opening all 3 files ii. Open - New file -> Syntax, then
/FILE={*,'pdt.sav'}
[/RENAME=(old=new)...]
[/IN=var_name]
[/SORT]
/FILE={*,'pst.sav'}
[/RENAME=(old=new)...]
[/IN=var_name]
[/SORT]
/FILE={*,'akaun.sav'}
[/RENAME=(old=new)...]
[/IN=var_name]
[/SORT]
iii. and press Run.
I know this is wrong, but i don't know how to make it right. Could someone
please give me some advise? This is 3 files has the exact variables. Thank
you very much.
Post by
See the chapter in the manual entitled "Combining Data Files".
J'
--
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3
See http://keys.gnupg.net or any PGP keyserver for public key.
_______________________________________________
Pspp-users mailing list
https://lists.gnu.org/mailman/listinfo/pspp-users
--
Alan D. Mead, Ph.D.
Assistant Professor of Industrial and Organizational Psychology
College of Psychology
Illinois Institute of Technology
3101 South Dearborn, 2nd floor
Chicago IL 60616

+312.567.5933 (Campus)
+815.588.3846 (Home Office)
+312.567.3493 (Fax)

http://www.iit.edu/~mead
http://www.alanmead.org

Announcing the Journal of Computerized Adaptive Testing (JCAT), a
peer-reviewed electronic journal designed to advance the science and
practice of computerized adaptive testing: http://www.iacat.org/jcat
Alan Mead
2012-06-27 00:55:17 UTC
Permalink
1970-01-01 00:00:00 UTC
Permalink
Thank you very much Mr. Alan ... I managed to combine my 3 files using your
Post by
You need to describe what you are trying to do.
--
Alan D. Mead, Ph.D.
Assistant Professor of Industrial and Organizational Psychology
College of Psychology
Illinois Institute of Technology
3101 South Dearborn, 2nd floor
Chicago IL 60616
+312.567.5933 (Campus)
+815.588.3846 (Home Office)
+312.567.3493 (Fax)
http://www.iit.edu/~mead
http://www.alanmead.org
Announcing the Journal of Computerized Adaptive Testing (JCAT), a
peer-reviewed electronic journal designed to advance the science and
practice of computerized adaptive testing: http://www.iacat.org/jcat
_______________________________________________
Pspp-users mailing list
https://lists.gnu.org/mailman/listinfo/pspp-users
--
View this message in context: http://old.nabble.com/Need-Help%3A-How-To-Combine-Data-From-3-Different-Files--tp34070199p34076256.html
Sent from the Gnu - PSPP - Users mailing list archive at Nabble.com.
zamdlr
2012-06-27 03:23:17 UTC
Permalink
1970-01-01 00:00:00 UTC
Permalink
I have 3 files before combined, which is pst.sav - 109 cases, pdt.sav - 17
cases & akaun.sav - 23 cases, when i combine this 3 files using this syntax:

ADD FILES
/FILE="C:\Documents and
Settings\KMS\Desktop\Research\ResearchICTMPPB\soalselidikict\pst.sav"

/FILE='C:\Documents and
Settings\KMS\Desktop\Research\ResearchICTMPPB\soalselidikict\pdt.sav'
/FILE='C:\Documents and
Settings\KMS\Desktop\Research\ResearchICTMPPB\soalselidikict\akaun.sav'
.
EXECUTE.

I get a new file will all the combine data, but the problem is, there were
empty cases from 110 onward until 142, from 143 onward i started to get all
the data from other files. What should i do to rectify this problem or how
can i delete those empty cases? Thank you.
--
View this message in context: http://old.nabble.com/Need-Help%3A-How-To-Combine-Data-From-3-Different-Files--tp34070199p34076314.html
Sent from the Gnu - PSPP - Users mailing list archive at Nabble.com.
zamdlr
2012-06-27 04:00:44 UTC
Permalink
1970-01-01 00:00:00 UTC
Permalink
They are probably blank records in the pst.sav file. If all of the good
records have some non-missing variable, like X, then you could use
syntax like:

* for numeric variables.
select if( not sysmis(X)).
execute.

or

* for string variables.
select if(not x='').
execute.

to remove such cases (they are removed from the working file in memory
as soon as you execute them, and they are permanently removed when you
save the working data file.

There's probably an easy interface way to do this, like highlighting
those rows and pressing "Delete".

-Alan
Post by
I have 3 files before combined, which is pst.sav - 109 cases, pdt.sav - 17
ADD FILES
/FILE="C:\Documents and
Settings\KMS\Desktop\Research\ResearchICTMPPB\soalselidikict\pst.sav"
/FILE='C:\Documents and
Settings\KMS\Desktop\Research\ResearchICTMPPB\soalselidikict\pdt.sav'
/FILE='C:\Documents and
Settings\KMS\Desktop\Research\ResearchICTMPPB\soalselidikict\akaun.sav'
.
EXECUTE.
I get a new file will all the combine data, but the problem is, there were
empty cases from 110 onward until 142, from 143 onward i started to get all
the data from other files. What should i do to rectify this problem or how
can i delete those empty cases? Thank you.
--
Alan D. Mead, Ph.D.
Assistant Professor of Industrial and Organizational Psychology
College of Psychology
Illinois Institute of Technology
3101 South Dearborn, 2nd floor
Chicago IL 60616

+312.567.5933 (Campus)
+815.588.3846 (Home Office)
+312.567.3493 (Fax)

http://www.iit.edu/~mead
http://www.alanmead.org

Announcing the Journal of Computerized Adaptive Testing (JCAT), a
peer-reviewed electronic journal designed to advance the science and
practice of computerized adaptive testing: http://www.iacat.org/jcat
Alan Mead
2012-06-27 04:06:27 UTC
Permalink
1970-01-01 00:00:00 UTC
Permalink
Again. Thank you very much Dr. Alan. I managed to settled the problem using
your technique. :handshake:
--
View this message in context: http://old.nabble.com/Need-Help%3A-How-To-Combine-Data-From-3-Different-Files--tp34070199p34076371.html
Sent from the Gnu - PSPP - Users mailing list archive at Nabble.com.
zamdlr
2012-06-27 04:37:45 UTC
Permalink
Continue reading on narkive:
Loading...