Exploring, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

Is this calculation possible in VA?

Reply
Occasional Learner
Posts: 1

Is this calculation possible in VA?

I have this dataset below - 

FacultyIDStudent IDTerm
1112010
1112011
1112012
1122013
1122014
1132012
1132013
1132014
1132015
2152011
2152012
2152013
2152015
2152016
2152017
2162011
2162012
2162013
2162014
3172012
3172014
3172016
3172018
3172020
3172022
3172024
4182012
4182013
4182014
4182015
4182016
4192016
4192017
4202016
4212012
4212013
4212014
4212015


I am interested in calculating the Average Terms a faculty is associated with a student. In the above example the average terms for fac id 1 is  3 for 2 it is 5, for 3 it is 7 and for 4 it is 3. 
Formula used is Sum(Count(Terms))/Count(Student ID) for every Faculty ID. 

I have other category variables associated with the student id and faculty id and hence want to calculate the item dynamically instead of aggregating the dataset prior ro bringing it into VA 7.3.  

Thanks for your responses. 

Occasional Contributor
Posts: 6

Re: Is this calculation possible in VA?

Posted in reply to IR_ANALYST_UCF

Hi there.  I think I have this figured out.

I used your data.  These are the steps that I took:

  1. I used each of the items as a category.
  2. I created a new custom item that concatenated the faculty ID and the student ID
    1. Fac ID - St ID = Concatenate(Format('FacultyID'n[Raw], 'BEST4.'), Format('Student ID'n[Raw], 'BEST4.'))
  3. I created 3 aggregated measures from Fac ID - St ID (you could do this with one)
    1. Count = Count [_ByGroup_] ('Fac ID - St ID'n)
    2. Distinct = Distinct [_ByGroup_] ('Fac ID - St ID'n)
    3. Avg = 'Count'n / 'Distinct'n

I was able to create the results you were looking for.

 

Cheers, Roger


result.jpg
Ask a Question
Discussion stats
  • 1 reply
  • 222 views
  • 0 likes
  • 2 in conversation