Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Calculating MODE Average

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Calculating MODE Average
 Login/Join
 
Virtuoso
posted
Does anyone have a good technique for calculating the MODE average? MODE average is the value which appears most frequently in a set of values. I am able to calculate the MODE average by making two passes at the data.

The first pass creates a count for each value in a HOLD file.

The second pass sorts the data BY HIGHEST count and then uses a COMPUTE and WHERE TOTAL to capture the first one. BY HIGHEST 1 does not give me only one when there is a tie.

The twist in this thing is that I am looking for the MODE average for ratings. If there is a tie between ratings, then I want the HIGHEST rating. SO I need to sort BY HIGHEST count and then BY HIGHEST rating and then take only the first one.

the following is an example using the car file.

TABLE FILE CAR
SUM SEATS
BY COUNTRY
BY CAR
ON TABLE HOLD
END

TABLE FILE HOLD
PRINT SEATS
COMPUTE CNTR/I1=IF (COUNTRY EQ LAST COUNTRY) THEN 0 ELSE 1;
BY COUNTRY
BY HIGHEST SEATS
BY HIGHEST CAR
WHERE TOTAL CNTR EQ 1
END

Any thoughts are appreciated.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
Master
posted Hide Post
Mickey

Your technique is great provided that you dont want to find the mode for more than one column of data. I used to use wf to work out quartiles and medians and the principle is the same.

The technique I used if I had 10 cols was to join to a table with 10 rows replicating the data and then use your technique on the set and then recombine it with across.

With multicolumns it's a pig to do in wf and much better done in some package.

Come to think of it where has the old focus statistical package gone.

Anyone know?



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
 
Posts: 888 | Location: Airstrip One | Registered: October 06, 2006Report This Post
Virtuoso
posted Hide Post
Fortunately I only need to do this for one column as you noted.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
Expert
posted Hide Post
John, ANALYZE FILE was written for mainframe by one of ibi's owners, Marty Stagowitz. It never got xlated completely in to wf. Once i asked Gerry if we could have some particular feature, and he said 'if you want ANALYZE we can give you ANALYZE' but it never happened, i think its too expensive to do in view of the number of good econometric packages out there. So IBI instead partnered with SPSS, which is a very very nice stat pack, i used to use it on the mainframe, back in the days of BIOMED and punch cards.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Calculating MODE Average

Copyright © 1996-2020 Information Builders