Post Reply 
HP 48G Linear Regression Best Fit Line
12-19-2021, 04:00 PM (This post was last modified: 12-19-2021 05:26 PM by Rodger Rosenbaum.)
Post: #33
RE: HP 48G Linear Regression Best Fit Line
Look at the two images part way down the page here:

https://stats.stackexchange.com/question...es-via-pca

The first image shows ordinary least squares which is what the HP48G LR function returns. The second image shows what the ORTH program returns.

I've got the full solution for you now.

Besides entering the ORTH program, create two new variables X and Y. Put your data in those variables as single column matrices, with X and Y being reversed from what was used previously. Designate X and Y parts of your latest data like this:

............X.............Y
248 29945.480 921.773
249 30002.951 922.245
251 30058.926 921.687
252 30114.903 923.001
254 30221.977 924.059

Type in another little program called OFIT:

<< X TRN DUP 1. CON AUGMENT TRN ORTH * Y - >>

Run it all like this:

Type your data into the ΣDAT matrix (as a two column matrix), run "Fit data..." in the statistics menu, type your X and Y data in separate single column matrices and store in the X and Y variables, then run OFIT.

Here's what I get when I do all this.

[ -.246561355 ]
[ -.240335279 ]
[ .783442323 ]
[ -.064763432 ]
[ -.231782261 ]

If you don't want to see so many digits, put "5 RND" at the end of the OFIT program.

The signs may be reversed from what you want--that's an easy fix, eh?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP 48G Linear Regression Best Fit Line - Rodger Rosenbaum - 12-19-2021 04:00 PM



User(s) browsing this thread: 2 Guest(s)