(12C Platinum) Statistical significance calculator
|
04-13-2023, 10:06 AM
(This post was last modified: 04-18-2023 01:40 PM by Tritonio.)
Post: #1
|
|||
|
|||
(12C Platinum) Statistical significance calculator
I translated a program that I had made for a few Casios (https://community.casiocalc.org/topic/81...-3650p-ii/) to the Platinum.
Register 1 is the total number of experiments. Register 2 is the probability of an experiment randomly succeeding. Register 3 is the number if experiments that succeeded. Running it with the above will tell you the your confidence that the number of successful experiments is irregular and not explained just by luck. Putting a zero on register 3 will instead find how many experiments would need to succeed so that you could be at least 99% sure that it's not by luck. Code: 001 RCL 3 It's my first program on the Platinum so it can probably be improved a lot. I can think of two improvements that I didn't have time to do. First, there is a big overlap between the case where register 3 was zero and the case where it wasn't. A good chunk of the code is the same so it could probably be reused and instead keep a flag that has the initial value of register 3 to decide what to do after we go out of the big shared code chunk. If you see the program in the Casio forum you'll notice that the long formula exists almost identical in two places. That that shared code I'm talking about. Second, I'm calculating combinations using n!. That means that the program won't support more than 69 total experiments (register 1) as the n! will overflow for that number. But if you expand the combinations formula and actually calculate the fraction with loops you can go MUCH higher than that without overflowing. But that would need much more code. |
|||
05-10-2023, 11:00 PM
(This post was last modified: 06-08-2023 07:19 PM by Tritonio.)
Post: #2
|
|||
|
|||
RE: (12C Platinum) Statistical significance calculator
Well, I rewrote it using my suggestions from my previous post.
Code:
It is probably slower than before, I think, I haven't done an actual comparison for the same input. But now it can work even with very big numbers that before would overflow the factorial. For example for 200->STO1, 11/12->STO2 and 0->STO3, it will take I think more than 30 minutes to return an answer but it will actually calculate it! It has wider range than even the original Casio BASIC program. I am unsure if this way of calculating the nCk (combinations) is accumulating too many rounding errors for big numbers. I may do some comparisons with Wolfram Alpha when I have some time. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)