~l3on/ubuntu/precise/rkward/rebuild1

« back to all changes in this revision

Viewing changes to tests/distributions/RKTestStandard.shapiro_wilk_test.rkcommands.R

  • 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
local({
 
2
## Prepare
 
3
## Compute
 
4
vars <- list (substitute (rock[["shape"]]), substitute (rock[["perm"]]))
 
5
results <- data.frame ('Variable Name'=rep (NA, length (vars)), check.names=FALSE)
 
6
for (i in 1:length (vars)) {
 
7
        results[i, 'Variable Name'] <- rk.get.description (vars[[i]], is.substitute=TRUE)
 
8
        var <- eval (vars[[i]], envir=globalenv())
 
9
        results[i, 'Length'] <- length (var)
 
10
        results[i, 'NAs'] <- sum (is.na(var))
 
11
        try ({
 
12
                test <- shapiro.test (var)
 
13
                results[i, 'Statistic'] <- paste (names (test$statistic), test$statistic, sep=" = ")
 
14
                results[i, 'p-value'] <- test$p.value
 
15
        })
 
16
}
 
17
## Print result
 
18
rk.header ("Shapiro-Wilk Normality Test")
 
19
rk.results (results)
 
20
})
 
21
.rk.rerun.plugin.link(plugin="rkward::shapiro_test", settings="length.state=1\nx.available=rock[[\\\"shape\\\"]]\\nrock[[\\\"perm\\\"]]", label="Run again")
 
22
.rk.make.hr()