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.
Anyone ever done a Multi Linear Regression to calculate the Slope and the Intercept. I know they have the REGRESS function, but that unfortunately doesn't give the formula.
I've got a scenario where I'm looking for the slope and intercept for a function with 2 "x" variables.
Guess I was checking to see if anyone has already encountered this and if there was a way to get the slope and intercept from the "REGRESS" function.
Prod: WebFOCUS 7.6.4 - Self Service - Windows Server2003 - Apache Tomcat 5.5 Dev: WebFOCUS 7.6.4 - Self Service - Windows XP SP2 - Apache Tomcat 5.5
The above links to a manual that pertains to the analyse command has formulas displayed for various kinds of regresssion. You need to login to tech support. I have these formulas in an old mainframe manual but there is no way for me type it here because of the various Greek symbols and sub/super scripts. I tried to cut and paste them from the above pdf report above but that did not work either. There were at least 3 fuctions (possibly more) that mention regression specifically. MULTR - for multiple linear regression, POLRG - polynomial regression, STEPR - stepwise multiple regression analysis. I think this still works on the mainframe but this stuff is way over my head as to what it means.
Good luck.
et
FOCUS 7.6 MVS PDF,HTML,EXCEL
Posts: 115 | Location: Chicago, IL | Registered: May 28, 2004
In the first step, I compute the slope and intercept, for all observations.:
-TYPE Calculating Slope and Intercept for Linear Equation to follow..
JOIN CLEAR *
DEFINE FILE ALLCHGIN
X/D15.4 = VOL_MNTH;
Y/D15.4 = VOLUME;
XY/D15.4 = X * Y;
XCUBED/D15.4 = X * X;
END
TABLE FILE ALLCHGIN
"Slope and Y Intercept Components"
" "
SUM X Y XY XCUBED CNT.X AVE.X AVE.Y
COMPUTE SLOPE/D15.4 = (XY - ((X * Y) / CNT.X)) /
(XCUBED - ((X * X) / CNT.X));
COMPUTE YINTERCEPT/D15.4 = IF CNT.X EQ 1 THEN 0 ELSE
AVE.Y - (SLOPE * AVE.X);
BY UNIT_ID
ON TABLE HOLD AS REGCALCS FORMAT FOCUS INDEX UNIT_ID
END
In the second step, I join my observation file, to my results file, and create my predicted values:
-TYPE Creating Predicted Values for the first sixty 'historical months'..
JOIN CLEAR *
JOIN UNIT_ID IN ALLCHGIN TO UNIT_ID IN REGCALCS AS GETCALS
DEFINE FILE ALLCHGIN
PREDICTED/D15.4 = YINTERCEPT +(SLOPE * VOL_MNTH);
END
TABLE FILE ALLCHGIN
PRINT VOL_MNTH
YINTERCEPT
SLOPE
VOLUME
PREDICTED
BY UNIT_ID
ON TABLE HOLD AS HISTMOS FORMAT FOCUS
END
Perhaps this code is adaptable to your requirements.
Regards, Dave
Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
Well I've come up with a solution that works for my application, so I thought I would share the code for other people that might be in the same scenario.
[CODE] -*... -* In the table with the data, we added -* COMPUTE ONE/I1 = 1; -* In order to join in the formula afterwards
TABLE FILE REGRESS1 SUM SLOPE INTERCEPT BY ONE ON TABLE HOLD AS REGRESS FORMAT FOCUS INDEX ONE END
JOIN ONE IN DATA TO ONE IN REGRESS ... [/CODE}
So assuming I renamed all the names correcty to the more generic example table, this was my solution for the multilinear equation in order to get the "formula" values.
Prod: WebFOCUS 7.6.4 - Self Service - Windows Server2003 - Apache Tomcat 5.5 Dev: WebFOCUS 7.6.4 - Self Service - Windows XP SP2 - Apache Tomcat 5.5