[rkward-cvs] SF.net SVN: rkward: [1513] trunk/rkward/rkward/plugins/analysis

sjar at users.sourceforge.net sjar at users.sourceforge.net
Wed Feb 28 23:00:25 UTC 2007


Revision: 1513
          http://svn.sourceforge.net/rkward/?rev=1513&view=rev
Author:   sjar
Date:     2007-02-28 15:00:24 -0800 (Wed, 28 Feb 2007)

Log Message:
-----------
* new test with no specific destination
* need for "Home" of them

Added Paths:
-----------
    trunk/rkward/rkward/plugins/analysis/TESTS/
    trunk/rkward/rkward/plugins/analysis/TESTS/PP_test.php
    trunk/rkward/rkward/plugins/analysis/TESTS/PP_test.rkh
    trunk/rkward/rkward/plugins/analysis/TESTS/PP_test.xml
    trunk/rkward/rkward/plugins/analysis/TESTS/mood_test.php
    trunk/rkward/rkward/plugins/analysis/TESTS/mood_test.rkh
    trunk/rkward/rkward/plugins/analysis/TESTS/mood_test.xml

Added: trunk/rkward/rkward/plugins/analysis/TESTS/PP_test.php
===================================================================
--- trunk/rkward/rkward/plugins/analysis/TESTS/PP_test.php	                        (rev 0)
+++ trunk/rkward/rkward/plugins/analysis/TESTS/PP_test.php	2007-02-28 23:00:24 UTC (rev 1513)
@@ -0,0 +1,40 @@
+<?
+	function preprocess () {
+	}
+
+	function calculate () {
+	$vars = "substitute (" . str_replace ("\n", "), substitute (", trim (getRK_val ("x"))) . ")";
+
+?>
+require(outliers)
+
+rk.temp.objects <- list (<? echo ($vars); ?>)
+rk.temp.results <- data.frame ('Variable Name'=rep (NA, length (rk.temp.objects)), check.names=FALSE)
+i=0;
+for (var in rk.temp.objects) {
+	i = i+1
+	rk.temp.results$'Variable Name'[i] <- rk.get.description (var, is.substitute=TRUE)
+	try ({
+		rk.temp.t <- PP.test (eval (var), lshort = <? getRK ("lshort"); ?>)
+		rk.temp.results$'Dickey-Fuller'[i] <- rk.temp.t$statistic
+		rk.temp.results$'Truncation lag parameter'[i] <- rk.temp.t$parameter
+		rk.temp.results$'p-value'[i] <- rk.temp.t$p.value
+	})
+}
+<?
+        }
+
+function printout () {
+?>
+rk.header ("Phillips-Perron Test for Unit Roots",
+	parameters=list ("Truncation lag parameter short ('TRUE') or long ('FALSE')", "<? getRK ("lshort"); ?>"))
+rk.results (rk.temp.results)
+<?
+}
+
+function cleanup () {
+?>
+rm (list=grep ("^rk.temp", ls (), value=TRUE))
+<?
+}
+?>


Property changes on: trunk/rkward/rkward/plugins/analysis/TESTS/PP_test.php
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/rkward/rkward/plugins/analysis/TESTS/PP_test.rkh
===================================================================
--- trunk/rkward/rkward/plugins/analysis/TESTS/PP_test.rkh	                        (rev 0)
+++ trunk/rkward/rkward/plugins/analysis/TESTS/PP_test.rkh	2007-02-28 23:00:24 UTC (rev 1513)
@@ -0,0 +1,22 @@
+<!DOCTYPE rkhelp>
+<document>
+	<summary>
+		This test computes the Phillips-Perron test for the null hypothesis that x has a unit root against a stationary alternative.
+	</summary>
+
+	<usage>
+		Select the data sets for which you want to perform the Phillips-Perron test. For this test the samples need to be numeric vectors (see below for details).
+	</usage>
+
+	<settings>
+		<caption id="tab_variables"/>
+		<setting id="x">Select the data to be computed. The vectors need to be numeric, and can be of different length.</setting>
+		<setting id="lshort">If checked (TRUE), the short version of the truncation lag parameter is used otherwise the long (FALSE).</setting>
+	</settings>
+	<related>
+		<ul>
+			<li><link href="rkward://rhelp/PP.test"/></li>
+		</ul>
+
+	</related>
+</document>

Added: trunk/rkward/rkward/plugins/analysis/TESTS/PP_test.xml
===================================================================
--- trunk/rkward/rkward/plugins/analysis/TESTS/PP_test.xml	                        (rev 0)
+++ trunk/rkward/rkward/plugins/analysis/TESTS/PP_test.xml	2007-02-28 23:00:24 UTC (rev 1513)
@@ -0,0 +1,22 @@
+<!DOCTYPE rkplugin>
+
+
+<document>
+	<code file="PP_test.php"/>
+	<help file="PP_test.rkh"/>
+	
+	<dialog label="Phillips-Perron Test for Unit Roots">
+		<tabbook>
+			<tab id="tab_variables" label="Basic settings">
+				<row>
+					<varselector id="vars"/>
+					<column>
+						<varslot type="numeric" id="x" multi="true" source="vars" required="true" label="variable(s):"/>
+						<checkbox id="lshort" label="short or long truncation lag parameter" value_unchecked="FALSE" value="TRUE" checked="true" />
+					</column>
+				</row>
+			</tab>
+		</tabbook>
+	</dialog>
+	
+</document>


Property changes on: trunk/rkward/rkward/plugins/analysis/TESTS/PP_test.xml
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/rkward/rkward/plugins/analysis/TESTS/mood_test.php
===================================================================
--- trunk/rkward/rkward/plugins/analysis/TESTS/mood_test.php	                        (rev 0)
+++ trunk/rkward/rkward/plugins/analysis/TESTS/mood_test.php	2007-02-28 23:00:24 UTC (rev 1513)
@@ -0,0 +1,34 @@
+<?
+function preprocess () {
+}
+
+function calculate () {
+
+?>
+rk.temp.x <- substitute (<? getRK ("x"); ?>)
+rk.temp.y <- substitute (<? getRK ("y"); ?>)
+rk.temp <- var.test (eval (rk.temp.x), eval (rk.temp.y), alternative = "<? getRK ("alternative"); ?>")
+
+<?
+}
+
+function printout () {
+?>
+rk.header ("Mood Two-Sample Test of Scale",
+	parameters=list ("Comparing", paste (rk.get.description (rk.temp.x, is.substitute=TRUE), "and", rk.get.description (rk.temp.y, is.substitute=TRUE)), "Alternative Hypothesis", "<? getRK ("alternative"); ?>"))
+
+rk.results (list (
+	'Variables'=rk.get.description (rk.temp.x, rk.temp.y, is.substitute=TRUE),
+	'Z'=rk.temp$statistic["Z"],
+	'p-value'=rk.temp$p.value,
+	'Alternative Hypothesis'=rk.describe.alternative(rk.temp)
+	))
+<?
+}
+
+function cleanup () {
+?>
+rm (list=grep ("^rk.temp", ls (), value=TRUE))
+<?
+}
+?>

Added: trunk/rkward/rkward/plugins/analysis/TESTS/mood_test.rkh
===================================================================
--- trunk/rkward/rkward/plugins/analysis/TESTS/mood_test.rkh	                        (rev 0)
+++ trunk/rkward/rkward/plugins/analysis/TESTS/mood_test.rkh	2007-02-28 23:00:24 UTC (rev 1513)
@@ -0,0 +1,23 @@
+<!DOCTYPE rkhelp>
+<document>
+	<summary>
+		This test performs the Mood Two-Sample Test of Scale.
+	</summary>
+
+	<usage>
+		Select two data sets to test for a difference in scale parameters by the Mood Two-Sample Test. For this test the samples need to be numeric vectors (see below for details).
+	</usage>
+
+	<settings>
+		<caption id="tab_variables"/>
+		<setting id="x">Select the data to be computed. The vectors need to be numeric.</setting>
+		<setting id="y">Select the data to be computed. The vectors need to be numeric.</setting>
+		<setting id="alternative">Here you can specify the alternative hypothesis. It must be one of "two sided", "greater" or "less".</setting>
+	</settings>
+	<related>
+		<ul>
+			<li><link href="rkward://rhelp/mood.test"/></li>
+		</ul>
+
+	</related>
+</document>

Added: trunk/rkward/rkward/plugins/analysis/TESTS/mood_test.xml
===================================================================
--- trunk/rkward/rkward/plugins/analysis/TESTS/mood_test.xml	                        (rev 0)
+++ trunk/rkward/rkward/plugins/analysis/TESTS/mood_test.xml	2007-02-28 23:00:24 UTC (rev 1513)
@@ -0,0 +1,26 @@
+<!DOCTYPE rkplugin>
+
+<document>
+	<code file="mood_test.php"/>
+	<help file="mood_test.rkh"/>
+	
+	<dialog label="Mood Two-Sample Test of Scale">
+		<tabbook>
+			<tab label="Basic settings" id="tab_variables">
+				<row>
+					<varselector id="vars"/>
+					<column>
+						<varslot type="numeric" id="x" source="vars" required="true" label="compare"/>
+						<varslot type="numeric" id="y" source="vars" required="true" label="against"/>
+						<radio id="alternative" label="using test hypothesis">
+							<option value="two.sided" label="Two-sided"/>
+							<option value="greater" label="First is greater"/>
+							<option value="less" label="Second is greater"/>
+						</radio>
+					</column>
+				</row>
+			</tab>
+		</tabbook>
+	</dialog>
+	
+</document>


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list