FAQ Database Discussion Community

How do I programmatically merge cases from datasets with conflicting variable names?

I want to add cases from many SPSS dataset to one SPSS dataset. Here's my code: DATASET ACTIVATE DataSet1. ADD FILES /FILE=* /FILE='Path\to\dataset.sav'. EXECUTE. But I get this error: Mismatched variable types on the input files. I want SPSS to ignore the conflicting columns and add cases only from the...

Count repeated values in variable and add results to a new one in SPSS

I have a SPSS dataset with information of different household members and I need to generate a new variable that counts the number of people that compose each one of these households.The original dataset is something like: ID | age | height 332 | 23 | 1.78 332 | 27...

Export SPSS output in a meaningful format (e.g. csv, tab)?

I have some output from SPSS that I've exported as a .txt file (but also as various Excel formats). Below is a snippet from that file. I need the observed and expected percentages for correlation, and this will happen for hundreds of these outputs (many different log linear models). Currently...

How to create a new table based on combination of two cells based on a third?

I have a field called "Conferences" and a second one called "Members". Each Conference has several Members who participate in this event. What I want to do is extract a table just with the binary relationship of "members" who participate in the same Conference. I will give an example. Lets...

SPSS Macro to create new variable based on 2 existing variables

I am trying to write a macro to perform the following operation: do if SYSMIS(V2). compute V3=V1. ELSE. compute V3=V2. end if. I tried several approaches, but it always gets stuck on the compute command. ...

Can't run k-means with SPSS Modeler 16

I'm using IBM SPSS modeler 16.0 to analyze my data that have four fields and all of them are retrived from a database as string and converted to numbers with the node replace using to_number(). When I connect my node to k-means node to create the clusters using that data...

Graphs in a loop in SPSS

I have a graph that works outside of a loop, but when it is included in a loop, I get the message "running inline gpl" and the error message "GPL error: id('graphdataset') not a quoted string: 'graphdataset'." Is there a special way to run graphs in a loop that I...

combine compute, loop and concat

I would like to run the following syntax on lots of variables. Thus, I'd like to loop over a bunch of variables. The syntax is the following: compute v3a_mit = v3a. recode v3a_mit (-9998=2) (sysmis=9). exe. In this case, however, the syntax only concerns the variable "v3a".I have some other...

How are numeric and string variables determined in SPSS?

So I found this page that explains the different types of variables very well: http://www.spss-tutorials.com/spss-variable-types-and-formats/ I would like to know though, how numeric and string types are differentiated when I export my data? Are numeric and string mapped to any code? I would like to parse SPSS data in Python....

SPSS Frequency Plot Complication

I am having a hard time generating precisely the frequency table I am looking for using SPSS. The data in question: cases (n = ~800) with categorical variables DX_n (n = 1-15), each containing ICD9 codes, many of which are the same code. I would like to create a frequency...

Opening .spo SPSS file in R

Good morning, I am just wondering if I can read a .spo SPSS output file in R? I have tried the foreign package but it won't allow me to read .spo files. Does anyone know if there any other way of reading this in R? thanks, Ayan ...

How can I download SPSS for macbook?

I need to SPSS for free for my macbook? I know SPSS is IBM production and its expensive but I want to know is there any way to download SPSS?

Fill blank variable with subsequent values

I have a dataset structured like below; id contracthours13 contracthours14 contracthours13u contracthours14u 12 . 13 . 13 13 30 30 . . 14 . . 15 16 15 . 5 6 7 If contracthours13 is missing I want the value in contracthours14 to move across. If this is missing then...