~ubuntu-branches/ubuntu/karmic/rkward/karmic

« back to all changes in this revision

Viewing changes to rkward/plugins/distributions/binomial_probabilities.php

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Friedrichsmeier
  • Date: 2006-11-06 16:30:00 UTC
  • mfrom: (1.2.1 upstream) (3.1.1 feisty)
  • Revision ID: james.westby@ubuntu.com-20061106163000-qi8ju75eqecrfay7
* new upstream release
* depend on either php4-cli or php5-cli

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?
2
 
        function preprocess () {
3
 
        }
4
 
        
5
 
        function calculate () {
 
2
function preprocess () {
 
3
}
 
4
 
 
5
function calculate () {
 
6
        global $q;
 
7
        $q = "c (" . preg_replace ("/[, ]+/", ", ", getRK_val ("q")) . ")";
6
8
?>
7
 
rk.temp <- (pbinom (q = <? getRK ("q"); ?>, size = <? getRK ("size"); ?>, prob = <? getRK ("prob"); ?>, <? getRK ("tail"); ?>))
 
9
rk.temp <- (pbinom (q = <? echo ($q); ?>, size = <? getRK ("size"); ?>, prob = <? getRK ("prob"); ?>, <? getRK ("tail"); ?>))
8
10
<?
9
 
        }
10
 
        
11
 
        function printout () {
 
11
}
12
12
 
13
 
                //produce the output
 
13
function printout () {
 
14
        global $q;
 
15
        //produce the output
14
16
?>
15
 
rk.header ("Binomial tail probability", list ("Variable value", "<? getRK ("q"); ?>", "Binomial trials", "<? getRK ("size"); ?>", "Probability of success", "<? getRK ("prob"); ?>", "Tail", "<? getRK ("tail"); ?>"));
 
17
rk.header ("Binomial tail probability", list ("Variable value", "<? echo ($q); ?>", "Binomial trials", "<? getRK ("size"); ?>", "Probability of success", "<? getRK ("prob"); ?>", "Tail", "<? getRK ("tail"); ?>"));
16
18
cat ("<h3>Binomial tail probability:  ", rk.temp, "</h3>")
17
19
<?
18
 
        }
19
 
        
20
 
        function cleanup () {
 
20
}
 
21
 
 
22
function cleanup () {
21
23
?>
22
24
rm (rk.temp)
23
25
<?
24
 
        }
 
26
}
25
27
?>