Quick Statistics Application

klaus

Expert
Licensed User
Longtime User
Hi Marc,

I had a look at your program.

I think that you didn't use the FloodFill routine the right way.
You are drawing onto the forelayer of the Form but if in the FloodFill routine you used frmMain.Image as the image, this one is the background image. So the routine will find no boundaries.
In your case the FloodFill routine will not improve the speed because you know the limits of the area to fill.

I made some changes in your program from the graphics point of view.
- the GrWidth should be an odd number and not an even one because of the 0 line.
- the scale, frame and the Gauss curve are drawn onto the background
- the filled areas are drawn onto the forelayer, this makes the erase function easier
- the StepSize variable is calculated

Best regards.
 
Last edited:

Stellaferox

Active Member
Licensed User
Hi Klaus,

Very elegant! thnx. You're right about the Floodfill routine. The challenge now is to enhance speed to get a good pocket pc performance.
Any ideas fellas?
Marc
 

klaus

Expert
Licensed User
Longtime User
Hi Marc,

I tried the program on my Qtek9090 (WM2003) and my htc-HD (WM6.1) and the speed is really not bad. It looks even somewhat slower on the htc-HD, compiled with AutoScale.

During these tests I noticed that the numbers of the scale were not displayed on my htc-HD. Changed the DrawLine line.
The program is updated in my previous post.

Best regards.
 

Stellaferox

Active Member
Licensed User
Hi Klaus, Dave,

I always feel that it is very difficult to dive into the depths of someone elses sourcecode. To be honest, when I review my own programs after a while I sometimes get lost by my own line of thinking.

To get to the point, I am really quite amazed that you succeeded to get right down to the core of the linedrawing routine and changed it to the better.
Nice work!

I feel this program is a nice try-out to speed things up in generating a drawing or calculating scores. I also thought of predrawing the curve and write away the data separately. Also a few routines are doubled in redrawing the curve and scores. At last I want the data after changing the Graphpage to be aalso transferred back to the main page. This is not difficult of course but the to-do list is growing....

Again, any idea is welcome!
Marc
 

klaus

Expert
Licensed User
Longtime User
Hi Marc,

I have played a bit with your program and have following suggestions:
- on frmMain, when clicking on the z CheckBox (cbA) only the valid Textbox is enabled the TextBox with the calculated value is disabled
- on frmGraph replaced the RadioButtons by ImageButtons (as a suggestion, could also be done on frmMain)
- on frmGraph fixed scale erase problem

I noticed that when you change in frmGraph the mean or SD value, the scale is changed, that's fine. But if you switch back to frmMain and go to frmGraph again the scale is OK but the values in the textboxes are not updated with the mean value nor with the SD value ?

Do you intend to add the possibility to enter a list of values or load a file with the list of values and calculate the max, min, mean, sd values, and with the possibility to edit the values in the list ?
And why not draw a histogram ?

Attached the updated version.

Best regards.
 

Stellaferox

Active Member
Licensed User
Hi Klaus,

Just put some simple graphics on the buttons on the Graph page.
The reason for not enabling the middle button with the z-score is that it cannot be altered. In fact it is a fairly useless score, just there to equal the other three inputs.
I like your changes!
Marc
 

klaus

Expert
Licensed User
Longtime User
Hi Marc,

Sorry, I forgot to send the images for the buttons.
The are now in the updated zip file.

That the middle TextBox is always disabled was clear to me.
What I changed is that only one textbox out of the 3 is enabled depending if the z checkbox is checked or unchecked either the upper one or the lower one.

Best regards.
 

Stellaferox

Active Member
Licensed User
Klaus,

The values computed by changing the (probability)buttons on the main page are no longer correct now.
Marc
 

Stellaferox

Active Member
Licensed User
Hi Klaus,

I seem to have done something yesterday that I cannot reproduce right now in this short time. The program works fine it seems. I want to tweak the program a little the coming weeks regarding smoothness, speed and lay-out. I like your buttons!

Marc
 

klaus

Expert
Licensed User
Longtime User
Hi Marc,

I tested the program and compared it with your version in post #20 and the results are the same.

When playing with it I found it not convenient that when you switch from one test to another the values in the other tests are set to 0.
I find it more convenient to keep these values but disable the textboxes and enable only those where the user can change values.
The attached version is modified that way.

It would also be nicer to have on frmMain the same buttons as on frmGraph instead of the radiobuttons.
I would even do everything with Imagebuttons, select the test, calculate, switch to Graph, help about etc. with 1 toolbar on top and no menu.
And why not show only the textboxes for a given test on top and in the lower part show the graphic so you have all you need on one form.
But that's just personal feeling.

Best regards.
 
Last edited:

Stellaferox

Active Member
Licensed User
Hi Klaus,

About the values set to zero when switching to another test: would you believe I had that in the first version? I really have nothing against that but changed it during building in the Graph page. This page is only used in the z <-> Pz score as the Graphs of the other values add no understanding of the value itself. I agree on the buttondisplay on the main page.
Regarding the simultaneous display of the Z-score and the Graphpage. This was originally the case but I decided against it to make an even appearance on the 4 different test. Moreover for someone who is used to the values itself, the Graph doesnot increase understanding the values. For students it might be useful that way. But feel free to modify at will.
David is using it for students. David: what do you think?
Marc
 

klaus

Expert
Licensed User
Longtime User
Hi Marc,

... would you believe I had that in the first version?

Oh yes, I believe, I made also several times the same experience that the first layout of a user interface was not the best one and changed it afterwards.

I attached a new version of the program, the graphic is still on it's own form. The graph is no more on top but on the bottom, because in when you wanted to enter values in the lower textboxes they were hidden by the virtual keyboard.

I think it would be usefull to have default values in all textboxes. What do you thinkabout'

Best regards.
 

Attachments

  • Statistics_K3.zip
    10 KB · Views: 233

Stellaferox

Active Member
Licensed User
Hi Klaus, looks very good and professional, though on the desktop the aligning might be adjusted here and there. To my personal liking I'd choose the overall display of all the tests but maybe Davids students would like this option better.
 

dlfallen

Active Member
Licensed User
Longtime User
I haven't had the chance to look at the latest versions. I'll get back to you when I am able.
 

dlfallen

Active Member
Licensed User
Longtime User
Here is some feedback. Remember, I'm trying to see this from the point of view of a beginning Statistics student who will probably take things at face value.

Z DISTRIBUTION
I would prefer word descriptions to the image labels. The students will be tested verbally (either multiple choice or essay), not by picking pictures and reinforcing the terminology would be good. There is room at the bottom to display (for example) "two-tailed" followed by the appropriate image button. Yes, the SIP will cover this up but I can assume the used knows how to minimize the pop-up keyboard when she or he is ready to select the appropriate tail(s) for the test.

Instead of a checkbox for z, it would be clearer to the new student if there were two radio buttons where one could choose between z and P(z).

For any given z score, the program correctly computes the left (1-tailed) probability but displays the same value for the right (1-tailed) probability which should be 1 minus the left tailed probability. Curiously, the graph correctly displays and labels the right tailed probability.

The P(z) textbox permits an entry greater than 1. Although no computation is performed when a button is clicked, neither is the student warned of impossible input. When a negative value is input, the program automatically changes it to a positive value. I would prefer an error message. It is harder for students to learn when their mistakes or misunderstandings are automatically corrected for them.

The display uses P(z) whereas the other three distributions use alpha.

The default on this distribution is to compute P(z). For the other three distributions the default is to compute the test statistic. Better if the default is the same for all four distributions.

On the graph page, I enter a mean of 100 and an SD of 15 which produces a picture of an IQ distribution (very nice). But if I exit to the first page and then hit the graph button again, I get an error "An error occurred on sub main.areafill. Line number 746".

CHI-SQUARE DISTRIBUTION
A bug - I can't get the df box to get focus, so no input there is possible.

Again, I would prefer two radio buttons to the one checkbox for alpha.

No graphic (tails) image buttons, one has to push the +- button. After learning to push the buttons at the right on the Z page, one has to now figure out the correct button to push. Why not a graphical image button here, even if it is only one button? Yes, I know Chi-square distribution can vary a lot in shape, but even so a representative button would be more intuitive at this point (the button should also have a verbal description, such as mentioned above).

t DISTRIBUTION
Same comment on radio buttons and descriptions for image buttons.

A df > 1 not only does not generate an error message, it performs a calculation which the student (not understanding probability) might accept as correct. An error message should be generated.

Although I haven't done much in the way of checking results, I notice in passing that when calculating t for df=12 and alpha = .10, I get the correct result for the 2-tailed test, but the 1-tailed test returns 2.18 instead of the correct answer of 1.36.

F DISTRIBUTION
Again, an alpha > 1 does not generate a warning.
If a calculate an F for alpha = 0 and df = 2/22 I get a very large F. If I then correct alpha to a realistic value (say .10) and push the +- button an error is given "An error occurred on sub main.dchoice. Line number 466."

IN GENERAL
The exit door button directly below the standard windows "X" button is redundant. I found myself pushing it to see what it would do and, of course, had to restart the program.

Baloon tips would be a great learning aid.

It would be most useful for the program to detect when infinity is the correct answer, and to supply that answer.

Ideally, I would like the ability to graph all four distributions, not just the Z distribution. The t distribution in particular would be great because it is used just as the Z distribution is used, only for small samples. I know this is wishful thinking and I don't expect you to jump on it, but it sure would be nice . . .

I really hope I don't sound too nit-picky. I know you have put a lot of work into this program and I really appreciate it. Some of these changes I would make myself if I had the time (which I don't at the moment). My main priorities are (1) accuracy of results, (2) consistency in the user interface, (3) making the usage as intuitive as possible, and (4) giving student's a learning experience.
 

Stellaferox

Active Member
Licensed User
Hi Dave,

Your suggestions are good of course. Unfortunately I don't have much time at hand at the moment but gradually I'll fix some of the issues you mentioned.
Is there a priorityorder in your list?
Marc
 

Stellaferox

Active Member
Licensed User
Hi Klaus,

Please do. I have no time next time. I feel that the suggestions as mentioned by Dave are good. Especially because he is working with students (as I do). I have a version for my own use (like your adjusted version) and this one should be used as well on th epocket pc as on the desktop.
Dave, agreed?
Marc
 
Top