## Forum archive 2000-2006

### Michael Gage - PGstatisticsmacros.p

by Arnold Pizer -
Number of replies: 0
 PGstatisticsmacros.pl topic started 2/6/2003; 9:44:47 PMlast post 8/4/2004; 2:32:19 PM
Michael Gage - PGstatisticsmacros.pl
2/6/2003; 9:44:47 PM (reads: 1402, responses: 2)

# Statistics Macros

### Normal distribution

    Usage: normal_prob(a, b, mean=>0, deviation=>1);

Computes the probability of x being in the interval (a,b) for normal distribution. The first two arguments are required. Use '-infty' for negative infinity, and 'infty' or '+infty' for positive infinity. The mean and deviation are optional, and are 0 and 1 respectively by default. Load PGnumericalmacros.pl in your problem if you use this method.

### "Inverse" of normal distribution

    Usage: normal_distr(prob, mean=>0, deviation=>1);

Computes the positive number b such that the probability of x being in the interval (0,b) is equal to the given probability (first argument). The mean and deviation are optional, and are 0 and 1 respectively by default. Caution: since students may use tables, they may only be able to provide the answer correct to 2 or 3 decimal places. Use tolerance when evaluating answers. Load PGnumericalmacros.pl if you use this method.

###### File path = /ww/webwork/pg/macros/PGstatisticsmacros.pl

<| Post or View Comments |>

 Neil Sigmon - Re: PGstatisticsmacros.pl  8/4/2004; 1:53:48 PM (reads: 1251, responses: 0) Hello, A colleague of mine is attempting to use some of the problem sets for statistics. When attempting to use the problem setProbability11CentralLimitTh/ur_pb_11_1.pg a pink warning page occurs - I have included some of it at the end of this message. The warning occurs as a result of the function normal_prob being called that is in the PGstatisticsmacros.pl macro. This problem also seems to be occuring in several other problems in the setProbability11CentralLimitTh and setProbability10NormalDist directories. We are still using an earlier version of WeBWorK (v. 1.8) and it is possible this problem might have already been addressed. Thank you very much for your help and time. Neil Sigmon Compiler warnings: * Odd number of elements in hash assignment at (eval 135) line 446. ##More details: -------- PG_priv::romberg called at (eval 138) line 64 ---- PG_priv::normal_prob called at (eval 54) line 27 ---- PG_priv::__ANON__ called at /home/webwork2/local/lib/perl5/5.6.1/sun4-solaris/Safe.pm line 222 ---- Safe::reval called at /home/webwork2/webwork/system/lib//PGtranslator.pm line 714 ---- PGtranslator::translate called at /home/webwork2/webwork/system/cgi/cgi-scripts/processProblem8.pl line 441 ----------------------------------- * This option |8| is not recognized in this subroutine HASH(0xb5b37c) 8 => at (eval 132) line 3674. ##More details: -------- PG_priv::set_default_options called at (eval 135) line 447 ---- PG_priv::romberg called at (eval 138) line 64 ---- PG_priv::normal_prob called at (eval 54) line 27 ---- PG_priv::__ANON__ called at /home/webwork2/local/lib/perl5/5.6.1/sun4-solaris/Safe.pm line 222 ---- Safe::reval called at /home/webwork2/webwork/system/lib//PGtranslator.pm line 714 ---- PGtranslator::translate called at /home/webwork2/webwork/system/cgi/cgi-scripts/processProblem8.pl line 441 -------------------------------------- <| Post or View Comments |>

 Arnold K. Pizer - Re: PGstatisticsmacros.pl  8/4/2004; 2:32:19 PM (reads: 1243, responses: 0) Hi Neil, This was fixed quite awhile ago. If you don't want to update your system, edit the file PGstatisticsmacros.pl changing line 64 from my $prob = romberg($function, $z_score_of_a,$z_score_of_b, 8); to my $prob = romberg($function, $z_score_of_a,$z_score_of_b, level => 8); i.e. replace "8" by "level => 8". Arnie <| Post or View Comments |>