hp41 howto do simple linear regression?  Printable Version + HP Forums (https://archived.hpcalc.org/museumforum) + Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum1.html) + Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum2.html) + Thread: hp41 howto do simple linear regression? (/thread25206.html) 
hp41 howto do simple linear regression?  David E  12172002 HI. I have the stat pac for hp41, and neither of the linear regressions sets seems to do what I need. I need something that I can input my data (x and y) and from that get R, slope, and y (y=mx+b). Thanks for any guidance .
Re: hp41 howto do simple linear regression?  Dave Shaffer (Arizona)  12172002 Well, David, you can always do it the semihard way  with just the '41 itself. If you use the sigma+ button (top left on the keypad)(after clearing the summation registers using the CLSigma button  shift x<>y key, just below the sigma+ key), you can accumulate the sums of x, x^2, y, y^2, and xy in memory registers 11 through 15 respectively, while register 16 will get the value of n (the number of x,y pairs). To put in your numbers, enter y first, then "ENTER", and then enter your x value  then hit the sigma+ key. After you have entered all you pairs of values, you need to remember (or be told  or, left as an exercise for the student, derive!) the leastsquares fitting expressions for slope, intercept, and correlation coefficient. In case you are rusty: the slope is (n*SUMxy  SUMx*Sumy)/(n*SUMx^2  (Sumx)^2)
the intercept has the numerator SUMy*SUMx^2  SUMxy*SUMx r is (n*SUMXY  SUMx*SUMy) / ( SQRT(n*SUMx^2  (SUMx)^2) * SQRT(n*SUMy^2  (SUMy)^2) ) I hope my notation is clear. SUMx means the summation of x, and (SUMx)^2 means to square this sum (whereas SUMx^2 means the summation of xsquared).
Have fun.
Re: hp41 howto do simple linear regression?  Vieira, Luiz C. (Brazil)  12172002 Hi; Dave Shaffer's post contains ALL information you need, but you can do it in the "easy way" by using the STAT pack programs. Get your Stat Pack manual and open it on page 32, under "Curve Fitting". On page 33, top left, you'll see your Y = a + bX expression. Now go to page 34 and you'll see that you should [XEQ] [SIGMA]LIN program for a straight line sample (or any of the other three: LOG, EXP or POW), being [SIGMA] the summation symbol. You should enter each pair in the REVERSED orther (why do some applications are against Y and X registers?), say: X [ENTER^] Y [A]for each pair; to correct any mistakes: X [ENTER^] Y [C]After the last (x,y) pair, simply press [E] and you'll have:
Hope this is waht you want. BUT if you really want to know the mechanics, read D. Shaffer's post. It is complete reference.
Success.
Re: hp41 howto do simple linear regression?  David  12172002 Boy, that scares me just looking at it. lol. maybe i will try to write a prog for that.
thanks
Re: hp42s how to operate it, do simple math  Kenneth  12172002 hi i'm trying to operate my 42s rpn scietific and i can't do a simple problem with it, i don't have a manual or instructions on how to operate it can you help me?
Re: hp41 howto do simple linear regression?  Mike (Stgt)  12182002 I just did an 'edit/copyedit/paste' from my emulator on the IBMhost, so the § stands for Sigma: 01·LBL "§" That's the minimum code, to make life easier just use the Alpha capabilities of the HP41 and add some literals and prompts.
Ciao.....Mike
Re: hp41 howto do simple linear regression?  Vieira, Luiz C. (Brazil)  12182002 Hi; I did not load the program and run it, but I am curious about one sequence: CL§ and MEAN. How can you compute MEAN if CL§ clears all statistic data? As you change the §REGS to R10 instead of original R16 and you execute CL§, I thought you created a buffer to compute partial data and return to §REG 16 before using MEAN. But right after that you clear statistic data and execute MEAN with all registers down to zero. Is that what you want? Did I miss something? If I am wrong, sorry. I just want to understand.
Cheers.
Re: hp41 howto do simple linear regression?  Mike (Stgt)  12182002 No, you did not miss something. I gave no clear explanation. This is my LinReg prgm that fits in every HP41, independent what other BIG routines use up all memory. There are no literals and no prompts to ease the user input and result output. After line 03 you may add the two lines "Y enter X §+" PROMPT. Without it you just see DATA ERROR and must know that this is the point to enter data.
Ciao.....Mike
Re: hp41 howto do simple linear regression?  Mike (Stgt)  12182002 Citation from Dave's append: "After you have entered all you pairs of values, you need to remember (or be told  or, left as an exercise for the student, derive!) the leastsquares fitting expressions for slope, intercept, and correlation coefficient."
To ease the exercise for the student just take the values of X as free of error. My little (basic) routine is based on this assumption. Next step in students exercise would be And if you have some time and piles of paper left, just take X as faulty as Y ;)
Ciao.....Mike
Re: hp42s how to operate it, do simple math  Richard Garner  12182002 Here is a quick primer 4+5=9
4 (4+5)x10=90
4 (4+5)/3=3
4 I hope this helps. Depending on how the numbers are set in the stack, you can load the stack with you numbers and the perform the operations all at once. As in (4x5)+7=27
7
Have fun.
Re: hp42s how to operate it, do simple math  a light hearted response  Tom (UK)  12192002 The HP42S is a tricky beast to master, and much harder without the manual. Best thing to do is pop it in the post to me and I'll return a much easier to use calculator in exchange... how about a Casio FX580?
But seriously: To start using it this site has a brief introduction on RPN.
To get a manual buy the DVD/CD's from this web site, it will be well worth it in the long run.
