[rkward-cvs] SF.net SVN: rkward: [1620] trunk/rkward/rkward/plugins
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Sun Mar 18 20:10:42 UTC 2007
Revision: 1620
http://svn.sourceforge.net/rkward/?rev=1620&view=rev
Author: tfry
Date: 2007-03-18 13:10:42 -0700 (Sun, 18 Mar 2007)
Log Message:
-----------
I assume, talking about two 'samples' is not technically correct for a paired test, so rename to two 'variables' (step 2)
Modified Paths:
--------------
trunk/rkward/rkward/plugins/analysis.pluginmap
Added Paths:
-----------
trunk/rkward/rkward/plugins/analysis/t_test_two_vars.php
trunk/rkward/rkward/plugins/analysis/t_test_two_vars.rkh
trunk/rkward/rkward/plugins/analysis/t_test_two_vars.xml
Removed Paths:
-------------
trunk/rkward/rkward/plugins/analysis/t_test_two_samples.php
trunk/rkward/rkward/plugins/analysis/t_test_two_samples.rkh
trunk/rkward/rkward/plugins/analysis/t_test_two_samples.xml
Deleted: trunk/rkward/rkward/plugins/analysis/t_test_two_samples.php
===================================================================
--- trunk/rkward/rkward/plugins/analysis/t_test_two_samples.php 2007-03-18 20:09:42 UTC (rev 1619)
+++ trunk/rkward/rkward/plugins/analysis/t_test_two_samples.php 2007-03-18 20:10:42 UTC (rev 1620)
@@ -1,57 +0,0 @@
-<?
-function preprocess () {
- global $x;
- global $y;
-
- $x = getRK_val ("x");
- $y = getRK_val ("y");
-?>
-names <- rk.get.description (<? echo ($x . ", " . $y); ?>)
-<?
-}
-
-function calculate () {
- global $x;
- global $y;
- global $varequal;
- global $paired;
-
- $conflevel = getRK_val ("conflevel");
- $varequal = getRK_val ("varequal");
- $paired = getRK_val ("paired");
- $hypothesis = getRK_val ("hypothesis");
-
- $options = ", alternative=\"" . $hypothesis . "\"";
- if ($paired) $options .= ", paired=TRUE";
- if ((!$paired) && $varequal) $options .= ", var.equal=TRUE";
- if ($conflevel != "0.95") $options .= ", conf.level=" . $conflevel;
-?>
-result <- t.test (<? echo ($x . ", " . $y . $options); ?>)
-<?
-}
-
-function printout () {
- global $varequal;
- global $paired;
-?>
-rk.header (result$method,
- parameters=list ("Comparing", paste (names[1], "against", names[2]),
- "H1", rk.describe.alternative (result)<?
- if (!$paired) { ?>
-,
- "Equal variances", "<? if (!$varequal) echo ("not"); ?> assumed"<?
- } ?>))
-
-rk.results (list (
- 'Variable Name'=names,
- 'estimated mean'=result$estimate,
- 'degrees of freedom'=result$parameter,
- t=result$statistic,
- p=result$p.value<?
- if (getRK_val ("confint")) { ?>,
- 'confidence interval percent'=(100 * attr(result$conf.int, "conf.level")),
- 'confidence interval of difference'=result$conf.int <? } ?>))
-<?
-}
-
-?>
Deleted: trunk/rkward/rkward/plugins/analysis/t_test_two_samples.rkh
===================================================================
--- trunk/rkward/rkward/plugins/analysis/t_test_two_samples.rkh 2007-03-18 20:09:42 UTC (rev 1619)
+++ trunk/rkward/rkward/plugins/analysis/t_test_two_samples.rkh 2007-03-18 20:10:42 UTC (rev 1620)
@@ -1,28 +0,0 @@
-<!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 samples are paired (repeated measurements on the same subject) or independent. 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://rhelp/cor"/></li>
- <li><link href="rkward://rhelp/cor.test"/></li>
- </ul>
- </related>
-</document>
Deleted: trunk/rkward/rkward/plugins/analysis/t_test_two_samples.xml
===================================================================
--- trunk/rkward/rkward/plugins/analysis/t_test_two_samples.xml 2007-03-18 20:09:42 UTC (rev 1619)
+++ trunk/rkward/rkward/plugins/analysis/t_test_two_samples.xml 2007-03-18 20:10:42 UTC (rev 1620)
@@ -1,52 +0,0 @@
-<!DOCTYPE rkplugin>
-<document>
- <code file="t_test_two_vars.php"/>
- <help file="t_test_two_vars.rkh"/>
-
- <logic>
- <convert id="notpaired" mode="equals" sources="paired.state" standard="0"/>
- <connect client="varequal.enabled" governor="notpaired"/>
- </logic>
-
- <dialog label="Two Variable t-Test">
- <tabbook>
- <tab label="Basic settings">
- <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">
- <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>
- <wizard label="Two Variable t-Test">
- <page>
- <text>As a first step, select the two variables you want to compare against each other. And specify, which one you theorize to be greater. Select two-sided, if your theory does not tell you, which variable is greater.</text>
- <copy id="basic_settings_row"/>
- </page>
- <page>
- <text>Below are some advanced options. It's generally safe not to assume the variables have equal variances. An appropriate correction will be applied then. Chosing "assume equal variances" may increase test-strength, however.</text>
- <copy id="varequal"/>
- <text>Sometimes it's helpful to get an estimate of the confidence interval of the difference in means. Below you can specify whether one should be shown, and which confidence-level should be applied (95% corresponds to a 5% level of significance).</text>
- <copy id="confint_frame"/>
- <stretch/>
- </page>
- </wizard>
-
-</document>
Copied: trunk/rkward/rkward/plugins/analysis/t_test_two_vars.php (from rev 1618, trunk/rkward/rkward/plugins/analysis/t_test_two_samples.php)
===================================================================
--- trunk/rkward/rkward/plugins/analysis/t_test_two_vars.php (rev 0)
+++ trunk/rkward/rkward/plugins/analysis/t_test_two_vars.php 2007-03-18 20:10:42 UTC (rev 1620)
@@ -0,0 +1,57 @@
+<?
+function preprocess () {
+ global $x;
+ global $y;
+
+ $x = getRK_val ("x");
+ $y = getRK_val ("y");
+?>
+names <- rk.get.description (<? echo ($x . ", " . $y); ?>)
+<?
+}
+
+function calculate () {
+ global $x;
+ global $y;
+ global $varequal;
+ global $paired;
+
+ $conflevel = getRK_val ("conflevel");
+ $varequal = getRK_val ("varequal");
+ $paired = getRK_val ("paired");
+ $hypothesis = getRK_val ("hypothesis");
+
+ $options = ", alternative=\"" . $hypothesis . "\"";
+ if ($paired) $options .= ", paired=TRUE";
+ if ((!$paired) && $varequal) $options .= ", var.equal=TRUE";
+ if ($conflevel != "0.95") $options .= ", conf.level=" . $conflevel;
+?>
+result <- t.test (<? echo ($x . ", " . $y . $options); ?>)
+<?
+}
+
+function printout () {
+ global $varequal;
+ global $paired;
+?>
+rk.header (result$method,
+ parameters=list ("Comparing", paste (names[1], "against", names[2]),
+ "H1", rk.describe.alternative (result)<?
+ if (!$paired) { ?>
+,
+ "Equal variances", "<? if (!$varequal) echo ("not"); ?> assumed"<?
+ } ?>))
+
+rk.results (list (
+ 'Variable Name'=names,
+ 'estimated mean'=result$estimate,
+ 'degrees of freedom'=result$parameter,
+ t=result$statistic,
+ p=result$p.value<?
+ if (getRK_val ("confint")) { ?>,
+ 'confidence interval percent'=(100 * attr(result$conf.int, "conf.level")),
+ 'confidence interval of difference'=result$conf.int <? } ?>))
+<?
+}
+
+?>
Copied: trunk/rkward/rkward/plugins/analysis/t_test_two_vars.rkh (from rev 1618, trunk/rkward/rkward/plugins/analysis/t_test_two_samples.rkh)
===================================================================
--- trunk/rkward/rkward/plugins/analysis/t_test_two_vars.rkh (rev 0)
+++ trunk/rkward/rkward/plugins/analysis/t_test_two_vars.rkh 2007-03-18 20:10:42 UTC (rev 1620)
@@ -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 samples are paired (repeated measurements on the same subject) or independent. 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://rhelp/cor"/></li>
+ <li><link href="rkward://rhelp/cor.test"/></li>
+ </ul>
+ </related>
+</document>
Copied: trunk/rkward/rkward/plugins/analysis/t_test_two_vars.xml (from rev 1619, trunk/rkward/rkward/plugins/analysis/t_test_two_samples.xml)
===================================================================
--- trunk/rkward/rkward/plugins/analysis/t_test_two_vars.xml (rev 0)
+++ trunk/rkward/rkward/plugins/analysis/t_test_two_vars.xml 2007-03-18 20:10:42 UTC (rev 1620)
@@ -0,0 +1,52 @@
+<!DOCTYPE rkplugin>
+<document>
+ <code file="t_test_two_vars.php"/>
+ <help file="t_test_two_vars.rkh"/>
+
+ <logic>
+ <convert id="notpaired" mode="equals" sources="paired.state" standard="0"/>
+ <connect client="varequal.enabled" governor="notpaired"/>
+ </logic>
+
+ <dialog label="Two Variable t-Test">
+ <tabbook>
+ <tab label="Basic settings">
+ <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">
+ <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>
+ <wizard label="Two Variable t-Test">
+ <page>
+ <text>As a first step, select the two variables you want to compare against each other. And specify, which one you theorize to be greater. Select two-sided, if your theory does not tell you, which variable is greater.</text>
+ <copy id="basic_settings_row"/>
+ </page>
+ <page>
+ <text>Below are some advanced options. It's generally safe not to assume the variables have equal variances. An appropriate correction will be applied then. Chosing "assume equal variances" may increase test-strength, however.</text>
+ <copy id="varequal"/>
+ <text>Sometimes it's helpful to get an estimate of the confidence interval of the difference in means. Below you can specify whether one should be shown, and which confidence-level should be applied (95% corresponds to a 5% level of significance).</text>
+ <copy id="confint_frame"/>
+ <stretch/>
+ </page>
+ </wizard>
+
+</document>
Modified: trunk/rkward/rkward/plugins/analysis.pluginmap
===================================================================
--- trunk/rkward/rkward/plugins/analysis.pluginmap 2007-03-18 20:09:42 UTC (rev 1619)
+++ trunk/rkward/rkward/plugins/analysis.pluginmap 2007-03-18 20:10:42 UTC (rev 1620)
@@ -6,7 +6,7 @@
<component type="standard" id="corr_matrix" file="analysis/corr_matrix.xml" label="Correlation Matrix" />
<component type="standard" id="cor_graph" file="plots/cor_graph.xml" label="Correlation Matrix Plot" />
<component type="standard" id="descriptive" file="descriptive/descriptive_statistics.xml" label="Descriptive Statistics" />
- <component type="standard" id="t_test_two_samples" file="analysis/t_test_two_samples.xml" label="Two Sample t-test" />
+ <component type="standard" id="t_test_two_vars" file="analysis/t_test_two_vars.xml" label="Two Variable t-test" />
<component type="standard" id="simple_anova" file="simple_anova/description.xml" label="Simple Anova" />
<component type="standard" id="wilcoxon_test" file="analysis/wilcoxon/wilcoxon_test.xml" label="Wilcoxon Test" />
<component type="standard" id="wilcoxon_exact_test" file="analysis/wilcoxon/wilcoxon_exact_test.xml" label="Wilcoxon exact test" />
@@ -29,7 +29,7 @@
<entry component="descriptive" index="2"/>
<menu id="means" label="Means" index="3">
<menu id="ttests" label="t-Tests" index="0">
- <entry component="t_test_two_samples" />
+ <entry component="t_test_two_vars" />
</menu>
</menu>
<entry component="simple_anova" index="6"/>
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