[EMAIL PROTECTED] wrote:

> John,
>
> I stand corrected.  I really guess I misunderstood what Mark wanted.
>
> I now realize he is an experienced programmer.

Well I have no idea if he is or not.  I suspect he may have underestimated the
difficulty of programming this in Basic for a Palm Pilot.  Good luck Mark.!

I can remember doing a repeated measures  ANOVA in FORTRAN  on a main frame as a
class project ( It finally worked but totally exhausted the class computing
budget :)  Prof was annoyed, I was amused. Don't give a project unless you
understand what you are really doing :)  We are talking a long time ago.
Possibly even pre-SAS!

> I'm sure that the correct
> BASIC routines can be found in a number of books on programming.  It seems to
> me I remember that Apple produced a book quite some time ago and it had in it
> the method of determining the probability of a Z value.

Probably all Mark wanted.

>
> I looked back at some programming I did quite a while back and came up with
> the following code.  I hop that Mark can use it.  I know it works in my
> software but it is only one of about six or seven things the user might want
> to know when dealing with Z values.

Err, are you talking about the distribution or the implications.  Two different
things I believe. The implications are more important , so to speak,  in
decision making but if all Mark wants is  the z-distribution that is another
matter.  It is up to him to know how to use it.


> Depending on the actual basic language that is used (GWBASIC, QUICKBasic,
> TurboBasic) this routine should find the probability of a given Z value to at
> least the fourth decimal place.

I think that this is exactly what he wants.  I get the feeling he does not want
the table  although as you sat below he could scan it into a Word document and
upload it.  His question was about actually calculating the value. I personally
do not really see the value  of the exact figure  at least at the undergrad
level ( or the grad level in most psych studies) but that is quite another
question.

>
> Of course Mark could scan a copy of the Z table and then put it into a Word
> document and load that onto the PalmPilot.  That way he could quickly refer
> to the table at any time.

Exactly what he did not want although quite possibly more immediately useful.
Copyright may apply?

>
> I assume Mark can write the code for entering the values.
>
> Here is the code, I hope it helps.
>
> ZOnly:
>   Mean=0
>   St.Dev=1
>   PROMPT$=" Enter the Z value to compare to the MEAN    "
>   X$="C"
>   PROMPT$=PROMPT$+PAD$ : PROMPT$=LEFT$(PROMPT$,57)
>   print PROMPT$;
>   input " ",X$
>   if X$="" OR X$=" " then X$="0"
>   IF X$="-" OR ASC(X$)<45 OR ASC(X$)>57 THEN
>     beep
>     print
>     print " Improper entry.  Please try again."
>     print
>     goto GeneralMenu
>   END IF
>   XX=VAL(X$)
>   Y=XX : Y=ABS(Y)
>
>   IF Y=0 THEN
>     beep : print
>     print "  Your entered value must not be zero.  Please try again."
>     print
>     input "  Depress <Enter> to continue ",rck$
>     goto GeneralMenu:
>   END IF
>
>   Y=ABS((Y-Mean)/St.Dev)
>   StandDevAway=Y
>   R=EXP(-(Y^2)/2)/2.5066282746
>   goto DoCalc
>
> ZRawData:
>   print
>   PROMPT$=" Enter the POPULATION MEAN value           "
>   X$="C"
>   PROMPT$=PROMPT$+PAD$ : PROMPT$=LEFT$(PROMPT$,57)
>   print PROMPT$;
>   input " ",X$
>   if X$="" OR X$=" " then X$="0"
>   IF X$="-" OR ASC(X$)<45 OR ASC(X$)>57 THEN
>     beep
>     print
>     print " Improper entry.  Please try again."
>     print
>     goto GeneralMenu
>   END IF
>   XX=VAL(X$)
>   Mean=XX
>
>   St.Dev=-1
>   WHILE St.Dev<=0
>     PROMPT$=" Enter the POPULATION STANDARD DEVIATION   "
>     X$="C"
>     PROMPT$=PROMPT$+PAD$ : PROMPT$=LEFT$(PROMPT$,57)
>     print PROMPT$;
>     input " ",X$
>     if VAL(X$)=-999 then goto OnToMenu
>     if X$="" or X$=" " then X$="0"
>     if X$="-" then X$="0"
>     if ASC(X$)<45 or ASC(X$)>57 then X$="0"
>     XX=VAL(X$)
>     IF XX<=0 THEN
>       beep
>       print
>       print " The Standard Deviation must be a positive number."
>       input " Please try again.  Depress <Enter> to continue ",rck$
>     END IF
>     St.Dev=XX
>   WEND
> AskStxx:
>   St.Dev=St.Dev/(SQR(SSize))
>   print
>   print "  Remember if you are comparing a value to the Mean you may want"
>   print " to enter lower class limit of that value.  For instance, if you"
>   print " are interested in a value of 13 you might want to enter 12.5."
>   print
>   PROMPT$=" Enter the value to compare to the MEAN    "
>   X$="C"
>   PROMPT$=PROMPT$+PAD$ : PROMPT$=LEFT$(PROMPT$,57)
>   print PROMPT$;
>   input " ",X$
>   if VAL(X$)=-999 then goto OnToMenu
>   if X$="" or X$=" " then X$=STR$(Mean)
>   if ASC(X$)<45 or ASC(X$)>57 then X$=STR$(Mean)
>   XX=VAL(X$)
>   Y=XX ': Y=ABS(Y)
>   IF Y=Mean THEN
>     beep : print
>     print "  Your entered a value that is equal to the Mean.  This results"
>     print " in a Z value of 0.
>     goto DoneShowing
>   END IF
>   Interest=Y
>   Y=ABS((Y-Mean)/St.Dev)
>   Top=Interest-Mean
>   StandDevAway=Y
>   R=EXP(-(StandDevAway^2)/2)/2.5066282746
>
> DoCalc:
>   cls : locate 4,1
>
>   if Top<0 then
>     StandDevAway=StandDevAway*(-1)
>     if SSize=1 then
>         kk=abs(Top)
>         print " The score entered is ";
>         print using fnform$(kk);abs(Top);
>         print " less than the Mean."
>     end if
>   end if
>
>   print " For a Z value of "; : print using FORM14$;StandDevAway
>   print
>   print " (y Ordinate at Z) FREQUENCY          = ";
>   print using FORM14$; R
>   Z=Y
>   Y=1/(1+.33267*ABS(Y))
>   T=1-R*(.4361836*Y-.1201676*Y^2+.937298*Y^3)
>   if Z<0 then T=1-T
>   print
>   print " (Area in Larger Portion) PROBABILITY = ";
>
>   print using FORM14$; T
>   print " (Area in Smaller Portion  one-tail   = ";
>   print using FORM14$; 1-T
>   print " (Area from Z to Mean      one-tail   = ";
>   print using FORM14$; .5-(1-T)
>
>   print " (Area in Smaller Portions two-tail   = ";
>   print using FORM14$; (1-T)*2
>   print
>
> DoneShowing:

Needs cleaning up for today ?? :) Mayhap a few to many Print's ?   :)

>
> Seems as though this is like re-inventing the wheel and I'm not sure if he
> helps to understand Z values or probability.

Meaningless in term of the question.  He just wanted to program it.  It may or
may not be of any use in understanding Z-values or probability. My guess it it
probably is  since he has to have an understanding of what he is programming
unless he is mindlessly typing and I doubt that even given the code you have
provided.

And yes re-inventing the wheel. Nothing wrong with that.  Shows he's interested
( or lazy ?)  either of which leads to advances in the area. I have heard it
suggested that all innovation came from people to lazy to do things 'this' way.

Any way,  thanks for the reply .

 ------------------
John Kane
The Rideau Lakes, Ontario Canada

PS.  May be those westerners are not as bad as we have heard.



=================================================================
Instructions for joining and leaving this list and remarks about
the problem of INAPPROPRIATE MESSAGES are available at
                  http://jse.stat.ncsu.edu/
=================================================================

Reply via email to