~l3on/ubuntu/precise/rkward/rebuild1

« back to all changes in this revision

Viewing changes to rkward/plugins/distributions/tests/ad_test.php

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Friedrichsmeier
  • Date: 2008-04-20 21:30:00 UTC
  • mfrom: (1.2.2 upstream) (3.1.9 hardy)
  • Revision ID: james.westby@ubuntu.com-20080420213000-fs4i8efmfc793bnn
new upstream release
closes: #475175
closes: #463348
closes: #475982

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?
 
2
function preprocess () { ?>
 
3
require(nortest)
 
4
<?
 
5
}
 
6
 
 
7
function calculate () {
 
8
        $vars = "substitute (" . str_replace ("\n", "), substitute (", trim (getRK_val ("x"))) . ")";
 
9
 
 
10
?>
 
11
vars <- list (<? echo ($vars); ?>)
 
12
results <- data.frame ('Variable Name'=rep (NA, length (vars)), check.names=FALSE)
 
13
for (i in 1:length (vars)) {
 
14
        results[i, 'Variable Name'] <- rk.get.description (vars[[i]], is.substitute=TRUE)
 
15
        var <- eval (vars[[i]], envir=globalenv ())
 
16
<?      if (getRK_val ("length")) { ?>
 
17
        results[i, 'Length'] <- length (var)
 
18
        results[i, 'NAs'] <- sum (is.na(var))
 
19
<?      } ?>
 
20
        try ({
 
21
                test <- ad.test (var)
 
22
                results[i, 'Statistic'] <- paste (names (test$statistic), test$statistic, sep=" = ")
 
23
                results[i, 'p-value'] <- test$p.value
 
24
        })
 
25
}
 
26
<?
 
27
}
 
28
 
 
29
function printout () {
 
30
?>
 
31
rk.header ("Anderson-Darling Normality Test")
 
32
 
 
33
rk.results (results)
 
34
<?
 
35
}
 
36
?>
 
 
b'\\ No newline at end of file'