[rkward-cvs] SF.net SVN: rkward:[3371] branches/jss_dec_10

tfry at users.sourceforge.net tfry at users.sourceforge.net
Thu Jan 20 17:01:10 UTC 2011


Revision: 3371
          http://rkward.svn.sourceforge.net/rkward/?rev=3371&view=rev
Author:   tfry
Date:     2011-01-20 17:01:10 +0000 (Thu, 20 Jan 2011)

Log Message:
-----------
Add plugin example

Modified Paths:
--------------
    branches/jss_dec_10/FINAL_JSS_TEX/example_plugin.tex
    branches/jss_dec_10/FINAL_JSS_TEX/revision_notes.txt

Added Paths:
-----------
    branches/jss_dec_10/examples/plugin_demo/demo.pluginmap
    branches/jss_dec_10/examples/plugin_demo/demo_t_test_two_vars.js
    branches/jss_dec_10/examples/plugin_demo/demo_t_test_two_vars.rkh
    branches/jss_dec_10/examples/plugin_demo/demo_t_test_two_vars.xml

Modified: branches/jss_dec_10/FINAL_JSS_TEX/example_plugin.tex
===================================================================
--- branches/jss_dec_10/FINAL_JSS_TEX/example_plugin.tex	2011-01-20 16:47:03 UTC (rev 3370)
+++ branches/jss_dec_10/FINAL_JSS_TEX/example_plugin.tex	2011-01-20 17:01:10 UTC (rev 3371)
@@ -24,7 +24,7 @@
 <document base_prefix="" namespace="rkward">
   <components>
     <component type="standard" id="t_test_two_vars"
-          file="analysis/t_test_two_vars.xml" label="Two Variable t-test" />
+          file="demo_t_test_two_vars.xml" label="Two Variable t-test" />
   </components>
 
   <hierarchy>
@@ -67,8 +67,8 @@
 \begin{Code}
 <!DOCTYPE rkplugin>
 <document>
-  <code file="t_test_two_vars.js"/>
-  <help file="t_test_two_vars.rkh"/>
+  <code file="demo_t_test_two_vars.js"/>
+  <help file="demo_t_test_two_vars.rkh"/>
 
   <logic>
     <connect client="varequal.enabled" governor="paired.not"/>

Modified: branches/jss_dec_10/FINAL_JSS_TEX/revision_notes.txt
===================================================================
--- branches/jss_dec_10/FINAL_JSS_TEX/revision_notes.txt	2011-01-20 16:47:03 UTC (rev 3370)
+++ branches/jss_dec_10/FINAL_JSS_TEX/revision_notes.txt	2011-01-20 17:01:10 UTC (rev 3371)
@@ -5,6 +5,32 @@
 
 o In itemized/bullet lists please capitalize the first word of the item. 
 
+o All code comments (#) should be removed and incorporated within the text
+of the manuscript.
+
+--- Notes from JSS that we have addressed, but which we are not entirely sure about ---
+
+Code:
+Please include a standalone replication script of all code/examples
+used within the manuscript
+
+We now provide
+- An R script to be run inside an RKWard session, which will replicate the
+examples from Sections 3, 4, and 5. Note that since most of these examples
+are concerned with interactive GUI elements, the script itself is interactive,
+and will prompt the user to perform certain actions, manually.
+- A sample data file used in Section 5. Since one example is concerned with
+importing this data file, the data cannot simply be inlined in the R script.
+- A set of files to replicate the plugin example in Section 6. These files
+cannot meaningfully be integrated into a standalone script.
+- A file README.txt with further instructions on using the examples.
+
+The scripts and files are only meaningful when used inside an RKWard session,
+not in a plain R session.
+
+Source code for RKWard 0.5.4 can be obtained from
+http://sourceforge.net/projects/rkward/files/Current_Stable_Releases/rkward-0.5.4.tar.gz/download .
+
 --- Notes from JSS that we have not addressed, yet ---
 
 Manuscript:
@@ -30,10 +56,6 @@
 	o please check all abbreviations
 	- see our notes below
 
-o All code comments (#) should be removed and incorporated within the text
-of the manuscript.
-
-
 o Figure placement (i.e. placement of floating objects): 
   The {figure} or {table} environment should be close to the first
   reference in the manuscript. It should first use the "t!" option for
@@ -43,11 +65,7 @@
 References
   - Java (not: JAVA, java)
 
-Code:
-Please include a standalone replication script of all code/examples
-used within the manuscript
 
-
 --- Items that we are not sure about ---
 ---- Use of the \proglang macro ----
 In several cases, we are not entirely sure, whether the use of the \proglang macro is called for or not.

Added: branches/jss_dec_10/examples/plugin_demo/demo.pluginmap
===================================================================
--- branches/jss_dec_10/examples/plugin_demo/demo.pluginmap	                        (rev 0)
+++ branches/jss_dec_10/examples/plugin_demo/demo.pluginmap	2011-01-20 17:01:10 UTC (rev 3371)
@@ -0,0 +1,18 @@
+<!DOCTYPE rkpluginmap>
+
+<document base_prefix="" namespace="rkward">
+  <components>
+    <component type="standard" id="t_test_two_vars"
+          file="demo_t_test_two_vars.xml" label="Two Variable t-test" />
+  </components>
+
+  <hierarchy>
+    <menu id="analysis" label="Analysis" index="4">
+      <menu id="means" label="Means" index="4">
+        <menu id="ttests" label="t-Tests">
+          <entry component="t_test_two_vars" />
+        </menu>
+      </menu>
+    </menu>
+  </hierarchy>
+</document>

Added: branches/jss_dec_10/examples/plugin_demo/demo_t_test_two_vars.js
===================================================================
--- branches/jss_dec_10/examples/plugin_demo/demo_t_test_two_vars.js	                        (rev 0)
+++ branches/jss_dec_10/examples/plugin_demo/demo_t_test_two_vars.js	2011-01-20 17:01:10 UTC (rev 3371)
@@ -0,0 +1,53 @@
+// globals
+var x;
+var y;
+var varequal;
+var paired;
+
+function preprocess () {
+  x = getValue ("x");
+  y = getValue ("y");
+
+  echo ('names <- rk.get.description (' + x + ", " + y + ')\n');
+}
+
+function calculate () {
+  varequal = getValue ("varequal");
+  paired = getValue ("paired");
+
+  var conflevel = getValue ("conflevel");
+  var hypothesis = getValue ("hypothesis");
+
+  var options = ", alternative=\"" + hypothesis + "\"";
+  if (paired) options += ", paired=TRUE";
+  if ((!paired) && varequal) options += ", var.equal=TRUE";
+  if (conflevel != "0.95") options += ", conf.level=" + conflevel;
+
+  echo ('result <- t.test (' + x + ", " + y + options + ')\n');
+}
+
+function printout () {
+  echo ('rk.header (result\$method, \n');
+  echo ('  parameters=list ("Comparing", paste (names[1], "against", names[2]),\n');
+  echo ('  "H1", rk.describe.alternative (result)');
+  if (!paired) {
+    echo (',\n');
+    echo ('  "Equal variances", "');
+    if (!varequal) echo ("not");
+    echo (' assumed"');
+  }
+  echo ('))\n');
+  echo ('\n');
+  echo ('rk.results (list (\n');
+  echo ('  \'Variable Name\'=names,\n');
+  echo ('  \'estimated mean\'=result\$estimate,\n');
+  echo ('  \'degrees of freedom\'=result\$parameter,\n');
+  echo ('  t=result\$statistic,\n');
+  echo ('  p=result\$p.value');
+  if (getValue ("confint")) {
+    echo (',\n');
+    echo ('  \'confidence interval percent\'=(100 * attr(result\$conf.int, "conf.level")),\n');
+    echo ('  \'confidence interval of difference\'=result\$conf.int ');
+  }
+  echo ('))\n');
+}

Added: branches/jss_dec_10/examples/plugin_demo/demo_t_test_two_vars.rkh
===================================================================
--- branches/jss_dec_10/examples/plugin_demo/demo_t_test_two_vars.rkh	                        (rev 0)
+++ branches/jss_dec_10/examples/plugin_demo/demo_t_test_two_vars.rkh	2011-01-20 17:01:10 UTC (rev 3371)
@@ -0,0 +1,28 @@
+<!DOCTYPE rkhelp>
+<document>
+	<summary>
+Two variable t-test (paired or independent samples).
+	</summary>
+
+	<usage>
+Chose two numeric vectors to compare against each other. Specify, whether the variables are paired or independent samples. For details, see below.
+	</usage>
+
+	<settings>
+		<caption id="tab_variables"/>
+		<setting id="x">A numeric vector for the first variable</setting>
+		<setting id="y">A numeric vector for the second variable</setting>
+		<setting id="hypothesis">Alternative hypothesis (H1) of the test.</setting>
+		<setting id="paired">Whether the variables are paired (repeated measurements on the same subject) or independent samples. For a paired test, if the two vectors are not of equal length, there will be an error.</setting>
+		<caption id="tab_options"/>
+		<setting id="varequal">Whether to assume equal variances for the two samples. This option is implied for a paired test.</setting>
+		<setting id="conflevel">Confidence level to use.</setting>
+		<setting id="confint">Whether to print the confidence interval of the estimated mean.</setting>
+	</settings>
+	<related>
+		<ul>
+			<li><link href="rkward://component/F_test"/></li>
+			<li><link href="rkward://rhelp/t.test"/></li>
+		</ul>
+	</related>
+</document>

Added: branches/jss_dec_10/examples/plugin_demo/demo_t_test_two_vars.xml
===================================================================
--- branches/jss_dec_10/examples/plugin_demo/demo_t_test_two_vars.xml	                        (rev 0)
+++ branches/jss_dec_10/examples/plugin_demo/demo_t_test_two_vars.xml	2011-01-20 17:01:10 UTC (rev 3371)
@@ -0,0 +1,42 @@
+<!DOCTYPE rkplugin>
+<document>
+  <code file="demo_t_test_two_vars.js"/>
+  <help file="demo_t_test_two_vars.rkh"/>
+
+  <logic>
+    <connect client="varequal.enabled" governor="paired.not"/>
+  </logic>
+
+  <dialog label="Two Variable t-Test">
+    <tabbook>
+      <tab label="Basic settings" id="tab_variables">
+        <row id="basic_settings_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="hypothesis" 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>
+            <checkbox id="paired" label="Paired sample" value="1" value_unchecked="0" />
+          </column>
+        </row>
+      </tab>
+      <tab label="Options" id="tab_options">
+        <checkbox id="varequal" label="assume equal variances" value="1"
+          value_unchecked="0"/>
+        <frame label="Confidence Interval" id="confint_frame">
+          <spinbox type="real" id="conflevel" label="confidence level" min="0" max="1"
+            initial="0.95"/>
+          <checkbox id="confint" label="print confidence interval" value="1"
+            checked="true"/>
+        </frame>
+        <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