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

sjar at users.sourceforge.net sjar at users.sourceforge.net
Wed Feb 28 22:59:30 UTC 2007


Revision: 1512
          http://svn.sourceforge.net/rkward/?rev=1512&view=rev
Author:   sjar
Date:     2007-02-28 14:59:30 -0800 (Wed, 28 Feb 2007)

Log Message:
-----------
* New Variances test
* some these new tests use the new rkward function "rk.describe.alternative"
* @ please take a look i.e. at bartlett_test. I chosed 'type=factor' for group (test data datasets:"InsectSprays") but why can I still "chose" numeric verctors? I assumes that such would be rejected in case of type="factor".

Added Paths:
-----------
    trunk/rkward/rkward/plugins/analysis/variances/
    trunk/rkward/rkward/plugins/analysis/variances/F_test.php
    trunk/rkward/rkward/plugins/analysis/variances/F_test.rkh
    trunk/rkward/rkward/plugins/analysis/variances/F_test.xml
    trunk/rkward/rkward/plugins/analysis/variances/bartlett_test.php
    trunk/rkward/rkward/plugins/analysis/variances/bartlett_test.rkh
    trunk/rkward/rkward/plugins/analysis/variances/bartlett_test.xml
    trunk/rkward/rkward/plugins/analysis/variances/fligner_test.php
    trunk/rkward/rkward/plugins/analysis/variances/fligner_test.rkh
    trunk/rkward/rkward/plugins/analysis/variances/fligner_test.xml

Added: trunk/rkward/rkward/plugins/analysis/variances/F_test.php
===================================================================
--- trunk/rkward/rkward/plugins/analysis/variances/F_test.php	                        (rev 0)
+++ trunk/rkward/rkward/plugins/analysis/variances/F_test.php	2007-02-28 22:59:30 UTC (rev 1512)
@@ -0,0 +1,40 @@
+<?
+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"); ?>", ratio = <? getRK ("ratio"); ?> <?
+if (($conflevel = getRK_val ("conflevel")) != "0.95") echo (", conf.level=" . $conflevel); ?>)
+
+<?
+}
+
+function printout () {
+?>
+rk.header ("F test to compare two variances",
+	parameters=list ("Comparing", paste (rk.get.description (rk.temp.x, is.substitute=TRUE), "against", rk.get.description (rk.temp.y, is.substitute=TRUE)),"Confidence Level", "<? getRK ("conflevel"); ?>", "Ratio", "<? getRK ("ratio"); ?>", "Alternative Hypothesis", "<? getRK ("alternative"); ?>"))
+
+rk.results (list (
+	'Variables'=rk.get.description (rk.temp.x, rk.temp.y, is.substitute=TRUE),
+	'F'=rk.temp$statistic["F"],
+	'Numerator DF'=rk.temp$parameter["num df"],
+	'Denominator DF'=rk.temp$parameter["denom df"],
+	'p-value'=rk.temp$p.value,
+	'Alternative Hypothesis'=rk.describe.alternative(rk.temp),
+	'Lower CI'=rk.temp$conf.int[1],
+	'Upper CI'=rk.temp$conf.int[2],
+	'ratio of variances'=rk.temp$estimate
+	))
+<?
+}
+
+function cleanup () {
+?>
+rm (list=grep ("^rk.temp", ls (), value=TRUE))
+<?
+}
+?>

Added: trunk/rkward/rkward/plugins/analysis/variances/F_test.rkh
===================================================================
--- trunk/rkward/rkward/plugins/analysis/variances/F_test.rkh	                        (rev 0)
+++ trunk/rkward/rkward/plugins/analysis/variances/F_test.rkh	2007-02-28 22:59:30 UTC (rev 1512)
@@ -0,0 +1,27 @@
+<!DOCTYPE rkhelp>
+<document>
+	<summary>
+		This test performs the F Test to compare two variances.
+	</summary>
+
+	<usage>
+		Select two samples from normal populations to compare the variances by the F 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>
+		<caption id="tab_options"/>
+		<setting id="ratio">Defines the hypothesized ratio of the population variances.</setting>
+		<setting id="conflevel">Here you can define the confidence level of the interval (95% is typical).</setting>
+	</settings>
+	<related>
+		<ul>
+			<li><link href="rkward://rhelp/var.test"/></li>
+			<li><link href="rkward://component/ansari_bradley_test"/></li>
+		</ul>
+
+	</related>
+</document>

Added: trunk/rkward/rkward/plugins/analysis/variances/F_test.xml
===================================================================
--- trunk/rkward/rkward/plugins/analysis/variances/F_test.xml	                        (rev 0)
+++ trunk/rkward/rkward/plugins/analysis/variances/F_test.xml	2007-02-28 22:59:30 UTC (rev 1512)
@@ -0,0 +1,30 @@
+<!DOCTYPE rkplugin>
+
+<document>
+	<code file="F_test.php"/>
+	<help file="F_test.rkh"/>
+	
+	<dialog label="F test">
+		<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>
+			<tab label="Options" id="tab_options">
+				<spinbox id="ratio" type="real" label="ratio" initial="1"/>
+				<spinbox  id="conflevel" type="real" label="confidence level" min="0" max="1" initial="0.95"/>
+			</tab>
+		</tabbook>
+	</dialog>
+	
+</document>

Added: trunk/rkward/rkward/plugins/analysis/variances/bartlett_test.php
===================================================================
--- trunk/rkward/rkward/plugins/analysis/variances/bartlett_test.php	                        (rev 0)
+++ trunk/rkward/rkward/plugins/analysis/variances/bartlett_test.php	2007-02-28 22:59:30 UTC (rev 1512)
@@ -0,0 +1,33 @@
+<?
+function preprocess () {
+}
+
+function calculate () {
+
+?>
+rk.temp.x <- substitute (<? getRK ("x"); ?>)
+rk.temp.y <- substitute (<? getRK ("y"); ?>)
+rk.temp <- bartlett.test (eval (rk.temp.x), eval (rk.temp.y))
+
+<?
+}
+
+function printout () {
+?>
+rk.header ("Bartlett Test of Homogeneity of Variances",
+	parameters=list ("Sample", paste (rk.get.description (rk.temp.x, is.substitute=TRUE), "and" ,"Group", rk.get.description (rk.temp.y, is.substitute=TRUE))))
+
+rk.results (list (
+	'Variables'=rk.get.description (rk.temp.x, rk.temp.y, is.substitute=TRUE),
+	'Bartlett s K-squared'=rk.temp$statistic,
+	'df'=rk.temp$parameter,
+	'p-value'=rk.temp$p.value))
+<?
+}
+
+function cleanup () {
+?>
+rm (list=grep ("^rk.temp", ls (), value=TRUE))
+<?
+}
+?>

Added: trunk/rkward/rkward/plugins/analysis/variances/bartlett_test.rkh
===================================================================
--- trunk/rkward/rkward/plugins/analysis/variances/bartlett_test.rkh	                        (rev 0)
+++ trunk/rkward/rkward/plugins/analysis/variances/bartlett_test.rkh	2007-02-28 22:59:30 UTC (rev 1512)
@@ -0,0 +1,23 @@
+<!DOCTYPE rkhelp>
+<document>
+	<summary>
+		This test performs the Bartlett Test of Homogeneity of Variances.
+	</summary>
+
+	<usage>
+		Select two samples from normal populations to compare the variances by the F 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 a factor.</setting>
+	</settings>
+	<related>
+		<ul>
+			<li><link href="rkward://rhelp/bartlett.test"/></li>
+			<li><link href="rkward://component/ansari_bradley_test"/></li>
+		</ul>
+
+	</related>
+</document>

Added: trunk/rkward/rkward/plugins/analysis/variances/bartlett_test.xml
===================================================================
--- trunk/rkward/rkward/plugins/analysis/variances/bartlett_test.xml	                        (rev 0)
+++ trunk/rkward/rkward/plugins/analysis/variances/bartlett_test.xml	2007-02-28 22:59:30 UTC (rev 1512)
@@ -0,0 +1,21 @@
+<!DOCTYPE rkplugin>
+
+<document>
+	<code file="bartlett_test.php"/>
+	<help file="bartlett_test.rkh"/>
+	
+	<dialog label="Bartlett Test of Homogeneity of Variances">
+		<tabbook>
+			<tab label="Basic settings" id="tab_variables">
+				<row>
+					<varselector id="vars"/>
+					<column>
+						<varslot type="numeric" id="x" source="vars" required="true" label="samples"/>
+						<varslot type="factor" id="y" source="vars" required="true" label="group"/>
+					</column>
+				</row>
+			</tab>
+		</tabbook>
+	</dialog>
+	
+</document>

Added: trunk/rkward/rkward/plugins/analysis/variances/fligner_test.php
===================================================================
--- trunk/rkward/rkward/plugins/analysis/variances/fligner_test.php	                        (rev 0)
+++ trunk/rkward/rkward/plugins/analysis/variances/fligner_test.php	2007-02-28 22:59:30 UTC (rev 1512)
@@ -0,0 +1,34 @@
+<?
+function preprocess () {
+}
+
+function calculate () {
+
+?>
+rk.temp.x <- substitute (<? getRK ("x"); ?>)
+rk.temp.y <- substitute (<? getRK ("y"); ?>)
+rk.temp <- bartlett.test (eval (rk.temp.x), eval (rk.temp.y))
+
+<?
+}
+
+function printout () {
+?>
+rk.header ("Fligner-Killeen Test of Homogeneity of Variances",
+	parameters=list ("Sample", paste (rk.get.description (rk.temp.x, is.substitute=TRUE), "Group", rk.get.description (rk.temp.y, is.substitute=TRUE))))
+
+rk.results (list (
+	'Variables'=rk.get.description (rk.temp.x, rk.temp.y, is.substitute=TRUE),
+	'Fligner-Killeen:med X^2 test statistic'=rk.temp$statistic,
+	'df'=rk.temp$parameter,
+	'p-value'=rk.temp$p.value
+	))
+<?
+}
+
+function cleanup () {
+?>
+rm (list=grep ("^rk.temp", ls (), value=TRUE))
+<?
+}
+?>

Added: trunk/rkward/rkward/plugins/analysis/variances/fligner_test.rkh
===================================================================
--- trunk/rkward/rkward/plugins/analysis/variances/fligner_test.rkh	                        (rev 0)
+++ trunk/rkward/rkward/plugins/analysis/variances/fligner_test.rkh	2007-02-28 22:59:30 UTC (rev 1512)
@@ -0,0 +1,24 @@
+<!DOCTYPE rkhelp>
+<document>
+	<summary>
+		This test performs the Fligner-Killeen Test of Homogeneity of Variances.
+	</summary>
+
+	<usage>
+		Select the data to perform the Fligner-Killeen (median) test of the null that the variances in each of the groups (samples) are the same. 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 a factor.</setting>
+	</settings>
+	<related>
+		<ul>
+			<li><link href="rkward://rhelp/fligner.test"/></li>
+			<li><link href="rkward://component/F_test"/></li>
+			<li><link href="rkward://component/ansari_bradley_test"/></li>
+		</ul>
+
+	</related>
+</document>

Added: trunk/rkward/rkward/plugins/analysis/variances/fligner_test.xml
===================================================================
--- trunk/rkward/rkward/plugins/analysis/variances/fligner_test.xml	                        (rev 0)
+++ trunk/rkward/rkward/plugins/analysis/variances/fligner_test.xml	2007-02-28 22:59:30 UTC (rev 1512)
@@ -0,0 +1,21 @@
+<!DOCTYPE rkplugin>
+
+<document>
+	<code file="fligner_test.php"/>
+	<help file="fligner_test.rkh"/>
+	
+	<dialog label="Fligner-Killeen Test of Homogeneity of Variances">
+		<tabbook>
+			<tab label="Basic settings" id="tab_variables">
+				<row>
+					<varselector id="vars"/>
+					<column>
+						<varslot type="numeric" id="x" source="vars" required="true" label="samples"/>
+						<varslot type="factor" id="y" source="vars" required="true" label="group"/>
+					</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