HP28S Programming help (requested) « Next Oldest | Next Newest »

 ▼ Christof (Davis, CA) Member Posts: 144 Threads: 20 Joined: Jan 1970 09-04-2002, 02:51 AM Well, with the new semester I've been pretty busy. I'm using the 32sii a lot, but I'm also getting a lot out of the 28s (especially in statistics). But I've got some issues with the RPL programming that I haven't figured out yet. The built in stats functions include a sample standard deviation, which is great. But I really need to write a bit of code to do a population standard devation (not by adding the mean to the sumdata and redoing the sdev as is done on the 20s) I'm - quite honestly- totally lost on this. (and then there's the rest of what I need to build- grabbing median, finding modes (with some reasonable guessing as to how many there might be), ranges, limits, and midpoints of grouped data....) Anyone want to pop a few tidbits out so I can get to the baby step stage instead of wondering how one starts thinking about sorts, summation, and etc in RPL? -C ▼ James M. Prange (Michigan) Posting Freak Posts: 1,041 Threads: 15 Joined: Jan 2005 09-04-2002, 04:21 AM It seems to me that once you have your statistics matrix, the following will give you the population standard deviation. Sigma stands for the upper case Greek sigma character, and SQRoot stands for the square root symbol. ```<< NSigma DUP 1 - SWAP / VAR * SQRoot >> ``` If you also want the population variance, leave out the SQRoot from the above, and take the square root of the variance when you do want the standard deviation. The Owner's Manual does have a program for finding the medians of the columns of the statistics data in the programming examples, but if I recall correctly, the sorting algorithm it uses isn't particularly fast. You might want to check http://www.hpcalc.org. Note that the 48SX doesn't have a built-in SORT command either; if you find a good sorting program for the 48SX, there's a pretty good chance that it will work on the 28S. ▼ Karl Schneider Posting Freak Posts: 1,792 Threads: 62 Joined: Jan 2005 09-04-2002, 06:42 AM This won't help Christof, but the HP-17Bii retains each datum entered by the user for statistical analysis. Thus, it has built-in routines for "min", "max", and "sort" that would not be possible with simple summation, as is done with the scientific units. While quite lacking in scientific functions, the 17Bii also has some handy functions, including: clock/alarm/appointments quick, easy-to-use TVM quick, easy-to-use calendar functions It's a nice complement to the scientific units. James M. Prange (Michigan) Posting Freak Posts: 1,041 Threads: 15 Joined: Jan 2005 09-04-2002, 07:11 AM Whoops, forgot there was more. The 28S has MAXSigma and MINSigma commands, which I believe are what you mean by limits, and the range is just the difference between them. I think that MSORT looks like the best bet for a 28S sorting routine, but read MSORT.TXT for how to change it so that it will work with a 28S as well as a 48. See http://www.hpcalc.org/details.php?id=2840 Modes sounds like the hard one, particularly for multi-modal distributions. I suppose that what I would do is make a histogram. First save SigmaDAT under some other name. Make a 2-column matrix with the elements of the first column representing the midpoint of each "bin" (group? I forget the proper term), and the second column initially all zeros, and store it as SigmaDAT. Try to choose boundaries such that no data will actually fall exactly on a boundary. Loop through the column of your statistics data that you're interested in, and for each element use nested IF... structures using one of the inequality tests (greater than, less than, etc.) to find out which "bin" it belongs in, and add 1 to the corresponding element in column 2 of SigmaDAT. Finally use SigmaDRW to draw a scatter plot. Note that you can use "indexed variables" on the 28S (but not on the 28C). That is, 'SigmaDAT(3,2)' EVAL recalls the object from the third row, second column of SigmaDAT, and 'SigmaDAT(3,2)' STO stores a real from level 1 there. Of course you can accomplish the same thing with GET and PUT. Sounds like a lot of work. Have you considered getting a 48G series? Regards, James ▼ Christof (Davis, CA) Member Posts: 144 Threads: 20 Joined: Jan 1970 09-04-2002, 11:34 AM Ah, I should have said "class limits". maxSigma does give a good single mode, which gives me a stock mean, sdev, and single mode for reports. (assuming sample populations) I really like the 28s- or even the 48sx. I've used a 48g and don't really care for the menu system on them much. (another alternative is to use a 41/42 variant for all of this, but one of my goals is to learn rpl programming) I'm looking through the gathered data so far, thanks for the what you've posted! -C Vieira, Luiz C. (Brazil) Posting Freak Posts: 4,027 Threads: 172 Joined: Aug 2005 09-04-2002, 12:11 PM Hello, Christof; I sent you an e-mail about this subject. Did you get it? Just to know... Cheers.

 Possibly Related Threads... Thread Author Replies Views Last Post HP28S screen noise generator Keith Midson 7 1,430 02-19-2012, 05:35 PM Last Post: Gilles Carpentier HP28S battery door trouble David Griffith 23 3,387 02-08-2012, 08:24 AM Last Post: Neil Hamilton (Ottawa) HP28S - made in Indonesia? Keith Midson 1 546 11-01-2010, 08:06 AM Last Post: Jeff O. ARM Assembler Help Requested... Bill Zimmerly 10 1,645 05-14-2010, 05:18 PM Last Post: Bill Zimmerly 82143A Printer Output Confirmation Requested Egan Ford 2 810 06-17-2009, 09:42 AM Last Post: Egan Ford HP28S battery cover Keith Midson 19 3,037 04-08-2009, 09:27 AM Last Post: Marcus von Cube, Germany HELP!!! Fixing HP28S (Battery Drain) lsegovic 10 1,818 12-14-2008, 09:44 PM Last Post: lsegovic HP28S production years? Yuhi 8 1,603 09-22-2006, 06:47 AM Last Post: Thomas Okken HP28S Battery Cover Preventative Maintenance? Les Wright 3 767 06-22-2006, 11:07 AM Last Post: ClacKidd Anyone have a photo of a broken HP28S battery cover? Han 8 1,478 05-19-2006, 03:46 PM Last Post: James M. Prange (Michigan)

Forum Jump: