First of all, I have only worked with SPSS for about a month, so I'm quite new to SPSS. The Problem is I want to follow a group of users of a certain drug on annual basis. I have several files each containing information on drug use for MANY types of drugs for a given year. I have between 4.5 and 5.0 millions cases(population) each with their own ID-number. I want to see how many of the users of a drug in 2008 use the same drug in 2009. I was advised to use the command below, but that ended with a pile of error messages in the syntax-window and as pop-ups after the command was executed. Can somebody help me? Hopefully with spesific suggestions:)
MATCH FILES /FILE = DataSet1 /IN = Metformin /FILE = DataSet2 /IN = Metformin BY= Metformin. SELECT IF (in DataSet1 EQ 1 AND in DataSet3 EQ 1). EXECUTE. Syntax error messages: MATCH FILES: A variable with the indicated name already exists. Check the variable names on the input files. MATCH FILES: A variable with the indicated name already exists. Check the variable names on the input files. MATCH FILES The working files has been restored, and subsequent commands may access the working files. SELECT IF: Incorrect variable name: either the name is more than 64 characters, or it is not defined by a previous command POP UP messages: Unrecoverable application error in Statistiscs Processor An unknown error has terminated communication with the processor. The SPSS Statistics Processor is unavailable |
Correction: SELECT IF (in DataSet1 EQ 1 AND in DataSet2 EQ 1)
|
Administrator
|
In reply to this post by Bergenmaster
Perhaps reading up on MATCH FILES and SELECT IF in the FM will be useful.??
-- MATCH FILES /FILE = DataSet1 /IN = Metformin_1 /FILE = DataSet2 /IN = Metformin_2 /BY= Metformin. SELECT IF (Metformin_1 AND Metformin_2). EXECUTE.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
In reply to this post by Bergenmaster
There are other things wrong here. I understand that you have just started using spss and syntax is just isn't Norwegian (Norsk?/Norge?). But read the syntax reference for this command because you are going to be using it a lot, given what you are doing.
MATCH FILES /FILE = DataSet1 /IN = Metformin1 /FILE = DataSet2 /IN = Metformin2/BY=ID-number. SELECT IF (Metformin1 EQ 1 AND Metformin2 EQ 1). EXECUTE. Gene Maguin -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Bergenmaster Sent: Thursday, October 04, 2012 8:13 AM To: [hidden email] Subject: Problems with Match Files First of all, I have only worked with SPSS for about a month, so I'm quite new to SPSS. The Problem is I want to follow a group of users of a certain drug on annual basis. I have several files each containing information on drug use for MANY types of drugs for a given year. I have between 4.5 and 5.0 millions cases(population) each with their own ID-number. I want to see how many of the users of a drug in 2008 use the same drug in 2009. I was advised to use the command below, but that ended with a pile of error messages in the syntax-window and as pop-ups after the command was executed. Can somebody help me? Hopefully with spesific suggestions:) MATCH FILES /FILE = DataSet1 /IN = Metformin /FILE = DataSet2 /IN = Metformin BY= Metformin. SELECT IF (in DataSet1 EQ 1 AND in DataSet3 EQ 1). EXECUTE. Syntax error messages: MATCH FILES: A variable with the indicated name already exists. Check the variable names on the input files. MATCH FILES: A variable with the indicated name already exists. Check the variable names on the input files. MATCH FILES The working files has been restored, and subsequent commands may access the working files. SELECT IF: Incorrect variable name: either the name is more than 64 characters, or it is not defined by a previous command POP UP messages: Unrecoverable application error in Statistiscs Processor An unknown error has terminated communication with the processor. The SPSS Statistics Processor is unavailable -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Problems-with-Match-Files-tp5715471.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Administrator
|
It seems that the following is relevant here!
-- http://www.diaryofaninja.com/blog/2012/10/02/the-pitfalls-of-cut-and-paste-coding
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
In reply to this post by Bergenmaster
At 08:13 AM 10/4/2012, Bergenmaster wrote:
>I want to follow a group of users of a certain drug on annual basis. >I have several files each containing information on drug use for >MANY types of drugs for a given year. I have between 4.5 and 5.0 >millions cases(population) each with their own ID-number. First, you write "I have only worked with SPSS for about a month; I was advised to use the command below": >MATCH FILES /FILE = DataSet1 /IN = Metformin /FILE = DataSet2 /IN = >Metformin >BY= Metformin. >SELECT IF (in DataSet1 EQ 1 AND in DataSet3 EQ 1). You're doing something fairly difficult, for having only used SPSS a month, especially if you haven't programmed in other languages. And that command was written by somebody who doesn't understand MATCH FILES. You *never* use the same variable ("Metformin") on more than one IN clause, and you never use the same variable on both an IN and a BY clause. You probably mean something more like MATCH FILES /FILE = DataSet1 /IN = In_1 /FILE = DataSet2 /IN = In_2 BY= Case_ID. SELECT IF (In_1 AND In_2). (What is the variable "Metformin" supposed to indicate? I've left it out altogether, because your original code uses it in two different, inconsistent ways, one of which ("BY") assumes it exists in the inputs, and one ("/IN") which assumes it doesn't.) But even correcting the MATCH FILES and SELECT IF probably won't solve your problem. To get farther, tell us how your input files are organized. You write, >I have several files each containing information on drug use for >MANY types of drugs for a given year. I have between 4.5 and 5.0 >millions cases(population) each with their own ID-number. Does that mean each record has a Case_ID and many 0/1 variable, each indicating non-use or use of a particular drug? Or does each record have a Case_ID and a Drug_ID variable, and a 0/1 variable indicating non-use or use of that drug? Or, what other organization? And, do the records contain a variable indicating what year they apply to? (I'm guessing they don't.) You may need an ADD FILES rather than a MATCH FILES solution, but we need to know more about your data, first. ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Free forum by Nabble | Edit this page |