LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2012)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 23 Feb 2012 09:12:51 -0500
Reply-To:   Gene Maguin <>
Sender:   "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:   Gene Maguin <>
Subject:   Re: Counting and constraints
In-Reply-To:   <67E5C383A5A84B49B5DB6E1685997C422A452D30@SRV-EXMB-001.phbern.local>
Content-Type:   multipart/alternative;


Maybe I don't understand something, but why can't you just count status.x variables that have a specific value?

Gene Maguin

From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Balmer, Thomas Sent: Thursday, February 23, 2012 5:51 AM To: SPSSX-L@LISTSERV.UGA.EDU Subject: Counting and constraints


In order to explain my problem, here what's the situation and what I have done so far:

1. A dataset with about 30'000 cases; a case is a course and a person ; when a person attended more than one course, she/he appears equal to the number of courses.

2. In order to get a person just once I changed cases to variables.

3. Now I got a person as a case with additional variables : courseID1 to courseID10; year.1 to year.10 (which is the year a course was attended) ; status.1 to status.10 (which is an additional information to the course).

4. I figured out with the list's help to count how many courses are mentioned in the dataset per person, say in the year 2010 : COUNT NumberOfCourses10=year.1 .2 year.3 year.4 year.5 year.6 year.7 year.8 year.9 year.10 (10).

But now I have to consider constraints : the variables status1 to status10 contains the information, whether a person really 'attended', stayed on the 'waiting list' , the course was 'cancelled' (and others, always as strings).

I'd like now to count the number of courses a year with the constraint, that this person also attended it, which means for the year 2010: year.1=10 AND status.1='attended'. So it should count the value 10 in the variable year.1 only if this course was attended.

How can I put this constraint in the syntax ?

Thanks !



Back to: Top of message | Previous page | Main SPSSX-L page