|Date: ||Thu, 23 Feb 2012 09:12:51 -0500|
|Reply-To: ||Gene Maguin <firstname.lastname@example.org>|
|Sender: ||"SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>|
|From: ||Gene Maguin <email@example.com>|
|Subject: ||Re: Counting and constraints|
Maybe I don't understand something, but why can't you just count status.x
variables that have a specific value?
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of
Sent: Thursday, February 23, 2012 5:51 AM
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
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 ?