[rkward-cvs] SF.net SVN: rkward: [2013] trunk/rkward/rkward/plugins/distributions/tests

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue Oct 2 10:17:35 UTC 2007


Revision: 2013
          http://rkward.svn.sourceforge.net/rkward/?rev=2013&view=rev
Author:   tfry
Date:     2007-10-02 03:17:35 -0700 (Tue, 02 Oct 2007)

Log Message:
-----------
NOT FOR 0.4.8: Update for jb test (by manchito)

Modified Paths:
--------------
    trunk/rkward/rkward/plugins/distributions/tests/jb_test.php
    trunk/rkward/rkward/plugins/distributions/tests/jb_test.rkh
    trunk/rkward/rkward/plugins/distributions/tests/jb_test.xml

Modified: trunk/rkward/rkward/plugins/distributions/tests/jb_test.php
===================================================================
--- trunk/rkward/rkward/plugins/distributions/tests/jb_test.php	2007-10-01 20:05:39 UTC (rev 2012)
+++ trunk/rkward/rkward/plugins/distributions/tests/jb_test.php	2007-10-02 10:17:35 UTC (rev 2013)
@@ -15,10 +15,15 @@
 	var <- eval (vars[[i]], envir=globalenv ())
 <?	if (getRK_val ("length")) { ?>
 	results[i, 'Length'] <- length (var)
+	results[i, 'NAs'] <- sum (is.na(var))
+<?	} 
+	if (getRK_val ("excludenas")) { ?>
+	var <- na.omit (var)
 <?	} ?>
 	try ({
 		test <- jarque.bera.test (var)
 		results[i, 'Statistic'] <- paste (names (test$statistic), test$statistic, sep=" = ")
+		results[i, 'df'] <- test$parameter
 		results[i, 'p-value'] <- test$p.value
 	})
 }
@@ -27,7 +32,7 @@
 
 function printout () {
 ?>
-rk.header ("Jarque-Bera Normality Test", parameters=list ("Degrees of freedom", test$parameter))
+rk.header ("Jarque-Bera Normality Test", parameters=list ("Exclude NAs", <? if (getRK_val ("excludenas")) echo "\"YES\""; else echo "\"NO\""; ?>))
 rk.results (results)
 <?
 }

Modified: trunk/rkward/rkward/plugins/distributions/tests/jb_test.rkh
===================================================================
--- trunk/rkward/rkward/plugins/distributions/tests/jb_test.rkh	2007-10-01 20:05:39 UTC (rev 2012)
+++ trunk/rkward/rkward/plugins/distributions/tests/jb_test.rkh	2007-10-02 10:17:35 UTC (rev 2013)
@@ -1,7 +1,7 @@
 <!DOCTYPE rkhelp>
 <document>
 	<summary>
-		This plugin calculates a Jarque-Bera chi-squared statistic for a variable x and tests against the null hypothesis of normality
+		This plugin calculates a Jarque-Bera chi-squared statistic for a variable x and tests against the null hypothesis of normality.
 	</summary>
 
 	<usage>
@@ -9,12 +9,13 @@
 		
 		The statistic's distribution is asynthotic, so this test performs better when working with big samples.
 
-		Make sure the data does not contain NAs, as this will usually prevent the test from succeeding.
+		Make sure the data does not contain NAs or, if so, that the 'Exclude NAs' option is checked, as neglecting this will usually prevent the test from succeeding.
 	</usage>
 
 	<settings>
-		<setting id="x">Select the data to be computed (one or more variables). The vectors need to be numeric and can be of different length. They must not contain NAs.</setting>
-		<setting id="length">Select if you want to include the number of observations in the output. (Default: YES)</setting>
+		<setting id="x">Select the data to be computed (one or more variables). The vectors need to be numeric and can be of different length.</setting>
+		<setting id="length">Select if you want to include the number of observations and NAs in the output. (Default: YES)</setting>
+		<setting id="excludenas">Select if your data has missing values. The NAs are then omitted when performing the test. (Default: YES)</setting>
 	</settings>
 	<related>
 		<ul>

Modified: trunk/rkward/rkward/plugins/distributions/tests/jb_test.xml
===================================================================
--- trunk/rkward/rkward/plugins/distributions/tests/jb_test.xml	2007-10-01 20:05:39 UTC (rev 2012)
+++ trunk/rkward/rkward/plugins/distributions/tests/jb_test.xml	2007-10-02 10:17:35 UTC (rev 2013)
@@ -6,18 +6,22 @@
 	<code file="jb_test.php"/>
 	<help file="jb_test.rkh" />
 	<dialog label="Jarque-Bera Normality Test">
+		<tabbook>
+			<tab label="Select Variables" >
 				<row>
 					<column>
 						<varselector id="vars"/>
 					</column>
 					<column>
 						<varslot type="numeric" multi="true" id="x" source="vars" required="true" label="variable(s):"/>
-						<checkbox id="length" label="Show Length" value_unchecked="0" value="1" checked="true" />
-						<text>
-							Note: Objects must not contain NAs
-						</text>
-						<stretch/>
 					</column>
 				</row>
+			</tab>
+			<tab label="Options">
+				<checkbox id="length" label="Show Length and NAs" value_unchecked="0" value="1" checked="true" />
+				<checkbox id="excludenas" label="Exclude NAs (the test will not run otherwise if present)" value_unchecked="0" value="1" checked="true" />
+				<stretch/>
+			</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