Aggregate to get the Average Number of Courses Per Student Per Semester

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Aggregate to get the Average Number of Courses Per Student Per Semester

Björn Türoque
Hi everyone,

I have been working with a dataset that details each individual course
enrolment, and I am trying to figure out the average number of enrolments
per person per semester. To accomplish this I have been Aggregating the data
with StudentID and SemesterCode as break variables. This gives me data like
this:

StudentID SemesterCode CoursesPerSemester
1468434  20041 4
1468434  20041 4
1468434  20041 4
1468434  20041 4
1468434  20042 1
1468434  20043 1
1123581  20041 2
1123581  20041 2
1123581  20042 3
1123581  20042 3
1123581  20042 3
1234567  20042 1
1234567  20043 2
1234567  20043 2

If I then take the average, or agregate the average of the data above by
person, I get an incorrect measure as the computer is averaging all of the
above numbers, instead of treating each semster individually. I want to get
the computer to agregate the data so it reports the average number of
courses per person per semester. Any help would be appreciated.

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: Aggregate to get the Average Number of Courses Per Student Per Semester

ViAnn Beadle
How about the SUMMARIZE procedure? AGGREGATE is used primarily to transform
data rather than analyze it.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Björn Türoque
Sent: Thursday, November 01, 2007 7:26 AM
To: [hidden email]
Subject: Aggregate to get the Average Number of Courses Per Student Per
Semester

Hi everyone,

I have been working with a dataset that details each individual course
enrolment, and I am trying to figure out the average number of enrolments
per person per semester. To accomplish this I have been Aggregating the data
with StudentID and SemesterCode as break variables. This gives me data like
this:

StudentID SemesterCode CoursesPerSemester
1468434  20041 4
1468434  20041 4
1468434  20041 4
1468434  20041 4
1468434  20042 1
1468434  20043 1
1123581  20041 2
1123581  20041 2
1123581  20042 3
1123581  20042 3
1123581  20042 3
1234567  20042 1
1234567  20043 2
1234567  20043 2

If I then take the average, or agregate the average of the data above by
person, I get an incorrect measure as the computer is averaging all of the
above numbers, instead of treating each semster individually. I want to get
the computer to agregate the data so it reports the average number of
courses per person per semester. Any help would be appreciated.

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: Aggregate to get the Average Number of Courses Per Student Per Semester

Maguin, Eugene
In reply to this post by Björn Türoque
Bjorn,

>>I have been working with a dataset that details each individual course
enrolment, and I am trying to figure out the average number of enrolments
per person per semester. To accomplish this I have been Aggregating the data
with StudentID and SemesterCode as break variables. This gives me data like
this:

StudentID SemesterCode CoursesPerSemester
1468434  20041 4
1468434  20041 4
1468434  20041 4
1468434  20041 4
1468434  20042 1
1468434  20043 1
1123581  20041 2
1123581  20041 2
1123581  20042 3
1123581  20042 3
1123581  20042 3
1234567  20042 1
1234567  20043 2
1234567  20043 2

I think there is something wrong with your aggregate command because if you
aggregated by person and semester, your result should look like.

ID     Semester Courses
1468434  20041 16
1468434  20042 1
1468434  20043 1
1123581  20041 4
1123581  20042 10
1234567  20043 4

Your syntax should read

Aggregate outfile=*/break=studentid semesterid/courses=nu.

What syntax statement did you use?


Gene Maguin

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: Aggregate to get the Average Number of Courses Per Student Per Semester

Marks, Jim
In reply to this post by Björn Türoque
Try:

MEANS semesterCode BY coursesPerSemester.

As ViAnn notes, this will analyse the data not transform it.

--jim

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Björn Türoque
Sent: Thursday, November 01, 2007 8:26 AM
To: [hidden email]
Subject: Aggregate to get the Average Number of Courses Per Student Per Semester

Hi everyone,

I have been working with a dataset that details each individual course enrolment, and I am trying to figure out the average number of enrolments per person per semester. To accomplish this I have been Aggregating the data with StudentID and SemesterCode as break variables. This gives me data like
this:

StudentID SemesterCode CoursesPerSemester
1468434  20041 4
1468434  20041 4
1468434  20041 4
1468434  20041 4
1468434  20042 1
1468434  20043 1
1123581  20041 2
1123581  20041 2
1123581  20042 3
1123581  20042 3
1123581  20042 3
1234567  20042 1
1234567  20043 2
1234567  20043 2

If I then take the average, or agregate the average of the data above by person, I get an incorrect measure as the computer is averaging all of the above numbers, instead of treating each semster individually. I want to get the computer to agregate the data so it reports the average number of courses per person per semester. Any help would be appreciated.

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: Aggregate to get the Average Number of Courses Per Student Per Semester

Björn Türoque
Perhaps I was not clear in my initial e-mail, the variable courses per
semester is a variable that tells you how many courses the individual took
in the current semester. So when an individual takes 4 courses in a semester
each individual course enrollment has the value 4 saved by it. I really just
want to get a new variable with the average number of courses per person per
semester, when I currently run aggregate with a sum, the value gives me the
average of all of the individual courses, thus that 4 gets averaged in 4
times making the average higher. Any suggestions.






On 11/1/07, Marks, Jim <[hidden email]> wrote:

>
> Try:
>
> MEANS semesterCode BY coursesPerSemester.
>
> As ViAnn notes, this will analyse the data not transform it.
>
> --jim
>
> -----Original Message-----
> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
> Björn Türoque
> Sent: Thursday, November 01, 2007 8:26 AM
> To: [hidden email]
> Subject: Aggregate to get the Average Number of Courses Per Student Per
> Semester
>
> Hi everyone,
>
> I have been working with a dataset that details each individual course
> enrolment, and I am trying to figure out the average number of enrolments
> per person per semester. To accomplish this I have been Aggregating the data
> with StudentID and SemesterCode as break variables. This gives me data like
> this:
>
> StudentID SemesterCode CoursesPerSemester
> 1468434  20041 4
> 1468434  20041 4
> 1468434  20041 4
> 1468434  20041 4
> 1468434  20042 1
> 1468434  20043 1
> 1123581  20041 2
> 1123581  20041 2
> 1123581  20042 3
> 1123581  20042 3
> 1123581  20042 3
> 1234567  20042 1
> 1234567  20043 2
> 1234567  20043 2
>
> If I then take the average, or agregate the average of the data above by
> person, I get an incorrect measure as the computer is averaging all of the
> above numbers, instead of treating each semster individually. I want to get
> the computer to agregate the data so it reports the average number of
> courses per person per semester. Any help would be appreciated.
>
> =====================
> 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
>



--
Björn Türoque
Some people are just born to rock!

====================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
Reply | Threaded
Open this post in threaded view
|

Re: Aggregate to get the Average Number of Courses Per Student Per Semester

Björn Türoque
Thanks everyone for your help, I have been looking into it, and it appears a
lag function will accomplish what I am Looking for. I am sure there is a way
to do it with aggregate, but lag will do it and It works. In essence I
needed to replace the extra 4s with system missing if they are in the same
semester and within the same individual.Then when I aggregate the average I
get the average number of courses per semester as a variable.




On 11/1/07, Björn Türoque <[hidden email]> wrote:

>
> Perhaps I was not clear in my initial e-mail, the variable courses per
> semester is a variable that tells you how many courses the individual took
> in the current semester. So when an individual takes 4 courses in a semester
> each individual course enrollment has the value 4 saved by it. I really just
> want to get a new variable with the average number of courses per person per
> semester, when I currently run aggregate with a sum, the value gives me the
> average of all of the individual courses, thus that 4 gets averaged in 4
> times making the average higher. Any suggestions.
>
>
>
>
>
>
> On 11/1/07, Marks, Jim <[hidden email] > wrote:
> >
> > Try:
> >
> > MEANS semesterCode BY coursesPerSemester.
> >
> > As ViAnn notes, this will analyse the data not transform it.
> >
> > --jim
> >
> > -----Original Message-----
> > From: SPSSX(r) Discussion [mailto:[hidden email] ] On Behalf
> > Of Björn Türoque
> > Sent: Thursday, November 01, 2007 8:26 AM
> > To: [hidden email]
> > Subject: Aggregate to get the Average Number of Courses Per Student Per
> > Semester
> >
> > Hi everyone,
> >
> > I have been working with a dataset that details each individual course
> > enrolment, and I am trying to figure out the average number of enrolments
> > per person per semester. To accomplish this I have been Aggregating the data
> > with StudentID and SemesterCode as break variables. This gives me data like
> > this:
> >
> > StudentID SemesterCode CoursesPerSemester
> > 1468434  20041 4
> > 1468434  20041 4
> > 1468434  20041 4
> > 1468434  20041 4
> > 1468434  20042 1
> > 1468434  20043 1
> > 1123581  20041 2
> > 1123581  20041 2
> > 1123581  20042 3
> > 1123581  20042 3
> > 1123581  20042 3
> > 1234567  20042 1
> > 1234567  20043 2
> > 1234567  20043 2
> >
> > If I then take the average, or agregate the average of the data above by
> > person, I get an incorrect measure as the computer is averaging all of the
> > above numbers, instead of treating each semster individually. I want to get
> > the computer to agregate the data so it reports the average number of
> > courses per person per semester. Any help would be appreciated.
> >
> > =====================
> > 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
> >
>
>
>
> --
> Björn Türoque
> Some people are just born to rock!




--
Björn Türoque
Some people are just born to rock!

====================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