~l3on/ubuntu/precise/rkward/rebuild1

« back to all changes in this revision

Viewing changes to rkward/plugins/analysis/wilcoxon/wilcoxon_exact_test.php

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Friedrichsmeier
  • Date: 2009-10-26 14:30:00 UTC
  • mfrom: (1.1.13 upstream) (6.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20091026143000-wzwt6cryjnwce23k
Tags: 0.5.2-1
* new upstream release
  closes: #551306 (added support for the new dynamic help system)
* Add "DM-Upload-Allowed: yes" in control
* bump standards version to 3.8.3 (no changes needed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?
2
 
function preprocess () { ?>
 
2
function preprocess () {
 
3
        global $y;
 
4
        $y = getRK_val ("y");
 
5
        if ($y != "") $y = ", " . $y;
 
6
?>
3
7
require(exactRankTests)
4
8
 
5
 
names <- rk.get.description (<? getRK ("x"); ?>, <? getRK ("y"); ?>)
 
9
names = rk.get.description (<? getRK ("x"); echo ($y); ?>)
6
10
<?
7
11
}
8
12
 
9
13
function calculate () {
 
14
        global $y;
 
15
 
10
16
        $exact_setting = getRK_val ("exact");
11
17
        if ($exact_setting == "yes") {
12
18
                $exact_opt = ", exact=TRUE";
13
19
        } else if ($exact_setting == "no") {
14
20
                $exact_opt = ", exact=FALSE";
15
21
        }
 
22
        if ($y != "") $paired_opt = ", paired = " . getRK_val ("paired");
 
23
        if (getRK_val ("confint") == "TRUE") {
 
24
                if (($conflevel = getRK_val("conflevel")) != "0.95") $conflevel_opt = ", conf.level=" . $conflevel;
 
25
        }
16
26
?>
17
 
result <- wilcox.exact (<? getRK ("x"); ?>, <? getRK ("y"); ?>, alternative = "<? getRK ("alternative"); ?>", mu = <? getRK ("mu"); ?>, paired = <? getRK ("paired"); ?><? echo ($exact_opt); ?>, correct = <? getRK ("correct"); ?>, conf.int = <? getRK ("confint"); ?> <?
18
 
if (($conflevel = getRK_val ("conflevel")) != "0.95") echo (", conf.level=" . $conflevel); ?>)
 
27
result <- wilcox.exact (<? getRK ("x"); echo ($y); ?>, alternative = "<? getRK ("alternative"); ?>", mu = <? getRK ("mu"); echo ($paired_opt); echo ($exact_opt); ?>, correct = <? getRK ("correct"); ?>, conf.int = <? getRK ("confint"); echo ($conflevel_opt); ?>)
19
28
 
20
29
<?
21
30
}
23
32
function printout () {
24
33
?>
25
34
rk.header (result$method,
26
 
        parameters=list ("Comparing", paste (names[1], "against", names[2]),
 
35
        parameters=list ("Comparing", paste (names, collapse=" against "),
27
36
        "H1", rk.describe.alternative (result),
28
37
        "Continuity correction in normal approximation for p-value", "<? getRK ("correct"); ?>",
29
38
        "Compute exact p-value", "<? getRK ("exact"); ?>", "Paired test", "<? getRK ("paired"); ?>",
35
44
        'Location Shift'=result$null.value,
36
45
        'Hypothesis'=result$alternative,
37
46
        p=result$p.value<?
38
 
        if (getRK_val ("confint")== "TRUE") { ?>,
 
47
        if (getRK_val ("confint") == "TRUE") { ?>,
39
48
        'confidence interval percent'=(100 * attr(result$conf.int, "conf.level")),
40
49
        'confidence interval of difference'=result$conf.int,
41
50
        'Difference in Location' = result$estimate<? } ?>))