[rkward-cvs] [rkward] /: Add i18n() calls to power analysis plugin.

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Mon Feb 2 10:20:19 UTC 2015


Git commit 6175544c28854e8ff07b4c8cda4584ee4e092b84 by Thomas Friedrichsmeier.
Committed on 02/02/2015 at 10:19.
Pushed by tfry into branch 'master'.

Add i18n() calls to power analysis plugin.

M  +3    -1    ChangeLog
M  +35   -25   rkward/plugins/analysis/power/Poweranalysis.js
M  +1    -1    rkward/plugins/analysis/power/Poweranalysis.rkh
M  +6    -0    rkward/plugins/analysis/power/Poweranalysis.xml
M  +35   -29   rkward/plugins/rkwarddev_scripts/rkwarddev_power_plugin_script.R
M  +21   -21   tests/analysis_plugins/power_analysis.rkcommands.R
M  +10   -10   tests/analysis_plugins/power_analysis.rkout

http://commits.kde.org/rkward/6175544c28854e8ff07b4c8cda4584ee4e092b84

diff --git a/ChangeLog b/ChangeLog
index c71f126..3464850 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,11 @@
+TODO 0.6.3:
+  - dirselectors on Windows
+  - talk to kde-18n-doc
 - New element <i18n> for use in plugins' logic section: Provides a translatable string property
 - New element <label> for use in plugin help pages: Copies the label-attribute of the given element into the text
 - New string property modifier "quoted" to make it easier to quote dynamic strings inside plugins
 - Reworked distribution calculator plugins
 - Added power analysis plugin (already existed as separate plugin)
-  - TODO: add automated tests
 - Assume plugin .js files to be in utf-8 encoding; this allows using non-ascii characters in the generated code
 - <matrix> element gains options min_rows and min_columns, and the details of fixed_width="true" have been improved
 - Fixed: <valueslot>s were quirky with respect to showing as invalid
diff --git a/rkward/plugins/analysis/power/Poweranalysis.js b/rkward/plugins/analysis/power/Poweranalysis.js
index 86a2f81..f8c8d7a 100644
--- a/rkward/plugins/analysis/power/Poweranalysis.js
+++ b/rkward/plugins/analysis/power/Poweranalysis.js
@@ -10,23 +10,24 @@ function preprocess(){
 
 function calculate(){
 	// read in variables from dialog
-	var drpPwrStat = getValue("drp_pwr_stat");
-	var spnNmbrfgrp = getValue("spn_Nmbrfgrp");
-	var drpPwrType = getValue("drp_pwr_type");
-	var drpPwrProptype = getValue("drp_pwr_proptype");
-	var drpPwrHypothesis = getValue("drp_pwr_hypothesis");
-	var radEffctEta = getValue("rad_effct_eta");
-	var radPwrParam = getValue("rad_pwr_param");
-	var spnPower = getValue("spn_Power");
-	var pwrSpinDf = getValue("pwr_spin_df");
-	var pwrSpinDfu = getValue("pwr_spin_dfu");
-	var pwrSpinDfv = getValue("pwr_spin_dfv");
-	var pwrSpinSample0 = getValue("pwr_spin_sample0");
-	var pwrSpinSample1 = getValue("pwr_spin_sample1");
-	var pwrSpinSample2 = getValue("pwr_spin_sample2");
-	var spnEffectsz = getValue("spn_Effectsz");
-	var spnSgnfcncl = getValue("spn_Sgnfcncl");
-	var svbSvrsltst = getValue("svb_Svrsltst");
+
+	var drpPwrStat = getString("drp_pwr_stat");
+	var spnNmbrfgrp = getString("spn_Nmbrfgrp");
+	var drpPwrType = getString("drp_pwr_type");
+	var drpPwrProptype = getString("drp_pwr_proptype");
+	var drpPwrHypothesis = getString("drp_pwr_hypothesis");
+	var radEffctEta = getString("rad_effct_eta");
+	var radPwrParam = getString("rad_pwr_param");
+	var spnPower = getString("spn_Power");
+	var pwrSpinDf = getString("pwr_spin_df");
+	var pwrSpinDfu = getString("pwr_spin_dfu");
+	var pwrSpinDfv = getString("pwr_spin_dfv");
+	var pwrSpinSample0 = getString("pwr_spin_sample0");
+	var pwrSpinSample1 = getString("pwr_spin_sample1");
+	var pwrSpinSample2 = getString("pwr_spin_sample2");
+	var spnEffectsz = getString("spn_Effectsz");
+	var spnSgnfcncl = getString("spn_Sgnfcncl");
+	var svbSvrsltst = getString("svb_Svrsltst");
 
 	// the R code to be evaluated
 	echo("\tpwr.result <- try(\n\t\t");
@@ -73,7 +74,8 @@ function calculate(){
 		if(radEffctEta == "f") {
 			echo(",\n\t\t\tf=" + spnEffectsz);
 		} else {
-			echo(",\n\t\t\tf=sqrt(" + spnEffectsz + "/(1-" + spnEffectsz + ")) # calculate f from eta squared");
+			echo(",\n\t\t\tf=sqrt(" + spnEffectsz + "/(1-" + spnEffectsz + "))");
+	comment("calculate f from eta squared", "\t");
 		}
 	}
 	}
@@ -170,24 +172,32 @@ function printout(){
 
 	var drpPwrStat = getValue("drp_pwr_stat");
 	var radPwrParam = getValue("rad_pwr_param");
-	echo("\t# Catch errors due to unsuitable data\n" + "\tif(class(pwr.result) == \"try-error\"){\n" + "\t\trk.print(\"Power analysis not possible with the data you provided\")\n" + "\t\treturn()\n\t}\n\n" + "\t# Prepare printout\n" + "\tnote <- pwr.result[[\"note\"]]\n" + "\tparameters <- list(\"Target measure\"=\"" + radPwrParam + "\")\n" + "\tif(!is.null(pwr.result[[\"alternative\"]])){\n\t\tparameters[[\"alternative\"]] <- pwr.result[[\"alternative\"]]\n\t}\n\n" + "\trk.header(pwr.result[[\"method\"]], parameters=parameters)\n" + "\tpwr.result[c(\"method\", \"note\", \"alternative\")] <- NULL\n" + "\tpwr.result <- as.data.frame(unlist(pwr.result))\n" + "\tcolnames(pwr.result) <- \"Parameters\"\n\n" + "\trk.results(pwr.result)\n" + "\tif(!is.null(note)){\n\t\trk.print(paste(\"<strong>Note:</strong> \", note))\n\t}\n\n");
+	comment("Catch errors due to unsuitable data", "\t");
+	echo("\tif(class(pwr.result) == \"try-error\"){\n" + "\t\trk.print(" + i18n("Power analysis not possible with the data you provided") + ")\n" + "\t\treturn()\n\t}\n\n");
+	comment("Prepare printout", "\t");
+	echo("\tnote <- pwr.result[[\"note\"]]\n");
+	header = new Header ().addFromUI ("rad_pwr_param");
+
+	echo("\tparameters <- list(");
+	echo (header.extractParameters ());
+	echo(")\n" + "\tif(!is.null(pwr.result[[\"alternative\"]])){\n\t\tparameters[[" + i18n("alternative") + "]] <- pwr.result[[\"alternative\"]]\n\t}\n\n" + "\trk.header(pwr.result[[\"method\"]], parameters=parameters)\n" + "\tpwr.result[c(\"method\", \"note\", \"alternative\")] <- NULL\n" + "\tpwr.result <- as.data.frame(unlist(pwr.result))\n" + "\tcolnames(pwr.result) <- " + i18n("Parameters") + "\n\n" + "\trk.results(pwr.result)\n" + "\tif(!is.null(note)){\n\t\trk.print(paste(" + i18n("<strong>Note:</strong>") + ", note))\n\t}\n\n");
 	if(drpPwrStat == "pwr.t.test" | drpPwrStat == "pwr.norm.test") {
-		echo("\trk.print(\"Interpretation of effect size <strong>d</strong> (according to Cohen):\")\n" + "\trk.results(data.frame(small=0.2, medium=0.5, large=0.8))\n");
+		echo("\trk.print(" + i18nc("Argument is name of statistic, e.g. 'r'", "Interpretation of effect size <strong>%1</strong> (according to Cohen):", "d") + ")\n" + "\trk.results(data.frame(" + i18nc("effect size", "small") + "=0.2, " + i18nc("effect size", "medium") + "=0.5, " + i18nc("effect size", "large") + "=0.8))\n");
 	}
 	if(drpPwrStat == "pwr.r.test") {
-		echo("\trk.print(\"Interpretation of effect size <strong>r</strong> (according to Cohen):\")\n" + "\trk.results(data.frame(small=0.1, medium=0.3, large=0.5))\n");
+		echo("\trk.print(" + i18nc("Argument is name of statistic, e.g. 'r'", "Interpretation of effect size <strong>%1</strong> (according to Cohen):", "r") + ")\n" + "\trk.results(data.frame(" + i18nc("effect size", "small") + "=0.1, " + i18nc("effect size", "medium") + "=0.3, " + i18nc("effect size", "large") + "=0.5))\n");
 	}
 	if(drpPwrStat == "pwr.f2.test") {
-		echo("\trk.print(\"Interpretation of effect size <strong>f<sup>2</sup></strong> (according to Cohen):\")\n" + "\trk.results(data.frame(small=0.02, medium=0.15, large=0.35))\n");
+		echo("\trk.print(" + i18nc("Argument is name of statistic, e.g. 'r'", "Interpretation of effect size <strong>%1</strong> (according to Cohen):", "f<sup>2</sup>") + ")\n" + "\trk.results(data.frame(" + i18nc("effect size", "small") + "=0.02, " + i18nc("effect size", "medium") + "=0.15, " + i18nc("effect size", "large") + "=0.35))\n");
 	}
 	if(drpPwrStat == "pwr.anova.test") {
-		echo("\trk.print(\"Interpretation of effect size <strong>f</strong> (according to Cohen):\")\n" + "\trk.results(data.frame(small=0.1, medium=0.25, large=0.4))\n");
+		echo("\trk.print(" + i18nc("Argument is name of statistic, e.g. 'r'", "Interpretation of effect size <strong>%1</strong> (according to Cohen):", "f") + ")\n" + "\trk.results(data.frame(" + i18nc("effect size", "small") + "=0.1, " + i18nc("effect size", "medium") + "=0.25, " + i18nc("effect size", "large") + "=0.4))\n");
 	}
 	if(drpPwrStat == "pwr.chisq.test") {
-		echo("\trk.print(\"Interpretation of effect size <strong>w</strong> (according to Cohen):\")\n" + "\trk.results(data.frame(small=0.1, medium=0.3, large=0.5))\n");
+		echo("\trk.print(" + i18nc("Argument is name of statistic, e.g. 'r'", "Interpretation of effect size <strong>%1</strong> (according to Cohen):", "w") + ")\n" + "\trk.results(data.frame(" + i18nc("effect size", "small") + "=0.1, " + i18nc("effect size", "medium") + "=0.3, " + i18nc("effect size", "large") + "=0.5))\n");
 	}
 	if(drpPwrStat == "pwr.p.test") {
-		echo("\trk.print(\"Interpretation of effect size <strong>h</strong> (according to Cohen):\")\n" + "\trk.results(data.frame(small=0.2, medium=0.5, large=0.8))\n");
+		echo("\trk.print(" + i18nc("Argument is name of statistic, e.g. 'r'", "Interpretation of effect size <strong>%1</strong> (according to Cohen):", "h") + ")\n" + "\trk.results(data.frame(" + i18nc("effect size", "small") + "=0.2, " + i18nc("effect size", "medium") + "=0.5, " + i18nc("effect size", "large") + "=0.8))\n");
 	}
 	//// save result object
 	// read in saveobject variables
diff --git a/rkward/plugins/analysis/power/Poweranalysis.rkh b/rkward/plugins/analysis/power/Poweranalysis.rkh
index fd40680..2dd4da4 100644
--- a/rkward/plugins/analysis/power/Poweranalysis.rkh
+++ b/rkward/plugins/analysis/power/Poweranalysis.rkh
@@ -6,7 +6,7 @@
 		Power analysis
 	</title>
 	<summary>
-		Perform power analysis for a variety of statistical methods.
+		Perform power analysis for a variety of statistcal methods.
 	</summary>
 	<usage>
 		Given three of the parameters 'power of test', 
diff --git a/rkward/plugins/analysis/power/Poweranalysis.xml b/rkward/plugins/analysis/power/Poweranalysis.xml
index cd25f87..4f5a95b 100644
--- a/rkward/plugins/analysis/power/Poweranalysis.xml
+++ b/rkward/plugins/analysis/power/Poweranalysis.xml
@@ -4,6 +4,12 @@
 			perhaps don't make changes here, but in the rkwarddev script instead! -->
 	<code file="Poweranalysis.js" />
 	<help file="Poweranalysis.rkh" />
+	<!-- <dependencies>
+			</dependencies> -->
+	<about name="Power analysis" shortinfo="RKWard GUI to perform power analysis and sample size estimation." longinfo="RKWard GUI to perform power analysis and sample size estimation." version="0.02-1" releasedate="2015-02-02" url="http://rkward.kde.org" license="GPL (>= 3)">
+		<author given="Meik" family="Michalke" email="meik.michalke at hhu.de" role="aut, cre" />
+		<author given="Thomas" family="Friedrichsmeier" email="thomas.friedrichsmeier at ruhr-uni-bochum.de" role="ctb" />
+	</about>
 	<logic>
 		<convert id="pwr_lgc_power" sources="rad_pwr_param.string" mode="equals" standard="Power" />
 		<convert id="pwr_lgc_sample" sources="rad_pwr_param.string" mode="equals" standard="Sample size" />
diff --git a/rkward/plugins/rkwarddev_scripts/rkwarddev_power_plugin_script.R b/rkward/plugins/rkwarddev_scripts/rkwarddev_power_plugin_script.R
index 0699c13..1b3c1f0 100644
--- a/rkward/plugins/rkwarddev_scripts/rkwarddev_power_plugin_script.R
+++ b/rkward/plugins/rkwarddev_scripts/rkwarddev_power_plugin_script.R
@@ -4,14 +4,12 @@
 # *EXCEPT* for the last call, see below.
 
 require(rkwarddev)
-rkwarddev.required("0.06-5")
+rkwarddev.required("0.07-1")
 
 local({
 # set the output directory to overwrite the actual plugin
 output.dir <- tempdir()
 overwrite <- TRUE
-# if you set guess.getters to TRUE, the resulting code will need RKWard >= 0.6.0
-guess.getter <- FALSE
 
 about.info <- rk.XML.about(
   name="rk.power",
@@ -20,10 +18,10 @@ about.info <- rk.XML.about(
       email="meik.michalke at hhu.de", role=c("aut","cre")),
     person(given="Thomas", family="Friedrichsmeier", email="thomas.friedrichsmeier at ruhr-uni-bochum.de", role=c("ctb"))),
   about=list(desc="RKWard GUI to perform power analysis and sample size estimation.",
-    version="0.01-3", url="http://rkward.kde.org")
+    version="0.02-1", url="http://rkward.kde.org")
   )
 dependencies.info <- rk.XML.dependencies(
-  dependencies=list(rkward.min=ifelse(isTRUE(guess.getter), "0.6.0", "0.5.6"),
+  dependencies=list(rkward.min="0.6.3",
   package=list(c(name="pwr")))
 )
 
@@ -356,7 +354,7 @@ pwr.js.calc <- rk.paste.JS(
       ite(id(pwr.parameter.rad, " != \"Effect size\""),
         ite(id(pwr.effect.etasq.rad, " == \"f\""),
           echo(",\n\t\t\tf=", pwr.input.effect),
-          echo(",\n\t\t\tf=sqrt(", pwr.input.effect,"/(1-", pwr.input.effect,")) # calculate f from eta squared")
+          rk.paste.JS (echo(",\n\t\t\tf=sqrt(", pwr.input.effect,"/(1-", pwr.input.effect,"))"), R.comment ("calculate f from eta squared"))
         )
       )
     )
@@ -461,47 +459,54 @@ pwr.js.calc <- rk.paste.JS(
   echo("\n\t\t)\n\t)\n\n")
 )
 
+helper.make.effect.size.legend <- function (indicator, small, medium, large) {
+   indicator <- dQuote (indicator)
+   rk.paste.JS (echo(
+      "\trk.print(", i18n ("Interpretation of effect size <strong>%1</strong> (according to Cohen):", indicator, context="Argument is name of statistic, e.g. 'r'"), ")\n",
+      "\trk.results(data.frame(", i18n ("small", context="effect size"), paste0 ("=", small, ", "),
+                                  i18n ("medium", context="effect size"), paste0 ("=", medium, ", "),
+                                  i18n ("large", context="effect size"), paste0 ("=", large, "))\n"))
+   )
+}
+
 pwr.js.print <- rk.paste.JS(
   rk.JS.vars(list(pwr.stat.drop, pwr.parameter.rad)),
+  R.comment ("Catch errors due to unsuitable data"),
   echo(
-    "\t# Catch errors due to unsuitable data\n",
     "\tif(class(pwr.result) == \"try-error\"){\n",
-    "\t\trk.print(\"Power analysis not possible with the data you provided\")\n",
-    "\t\treturn()\n\t}\n\n",
-    "\t# Prepare printout\n",
-    "\tnote <- pwr.result[[\"note\"]]\n",
-    "\tparameters <- list(\"Target measure\"=\"", pwr.parameter.rad, "\")\n",
-    "\tif(!is.null(pwr.result[[\"alternative\"]])){\n\t\tparameters[[\"alternative\"]] <- pwr.result[[\"alternative\"]]\n\t}\n\n",
+    "\t\trk.print(", i18n ("Power analysis not possible with the data you provided"), ")\n",
+    "\t\treturn()\n\t}\n\n"),
+  R.comment ("Prepare printout"),
+  echo ("\tnote <- pwr.result[[\"note\"]]\n"),
+  id ("header = new Header ().addFromUI (\"", pwr.parameter.rad, "\");\n", js=FALSE),
+  echo ("\tparameters <- list("),
+  "echo (header.extractParameters ());",
+  echo (")\n",
+    "\tif(!is.null(pwr.result[[\"alternative\"]])){\n\t\tparameters[[", i18n ("alternative"), "]] <- pwr.result[[\"alternative\"]]\n\t}\n\n",
     "\trk.header(pwr.result[[\"method\"]], parameters=parameters)\n",
     "\tpwr.result[c(\"method\", \"note\", \"alternative\")] <- NULL\n",
     "\tpwr.result <- as.data.frame(unlist(pwr.result))\n",
-    "\tcolnames(pwr.result) <- \"Parameters\"\n\n",
+    "\tcolnames(pwr.result) <- ", i18n ("Parameters"), "\n\n",
     "\trk.results(pwr.result)\n",
-    "\tif(!is.null(note)){\n\t\trk.print(paste(\"<strong>Note:</strong> \", note))\n\t}\n\n"
+    "\tif(!is.null(note)){\n\t\trk.print(paste(", i18n ("<strong>Note:</strong>"), ", note))\n\t}\n\n"
   ),
   ite(id(pwr.stat.drop, " == \"pwr.t.test\" | ", pwr.stat.drop, " == \"pwr.norm.test\""),
-    echo("\trk.print(\"Interpretation of effect size <strong>d</strong> (according to Cohen):\")\n",
-      "\trk.results(data.frame(small=0.2, medium=0.5, large=0.8))\n")
+    helper.make.effect.size.legend ("d", "0.2", "0.5", "0.8")
   ),
   ite(id(pwr.stat.drop, " == \"pwr.r.test\""),
-    echo("\trk.print(\"Interpretation of effect size <strong>r</strong> (according to Cohen):\")\n",
-      "\trk.results(data.frame(small=0.1, medium=0.3, large=0.5))\n")
+    helper.make.effect.size.legend ("r", "0.1", "0.3", "0.5")
   ),
   ite(id(pwr.stat.drop, " == \"pwr.f2.test\""),
-    echo("\trk.print(\"Interpretation of effect size <strong>f<sup>2</sup></strong> (according to Cohen):\")\n",
-      "\trk.results(data.frame(small=0.02, medium=0.15, large=0.35))\n")
+    helper.make.effect.size.legend ("f<sup>2</sup>", "0.02", "0.15", "0.35")
   ),
   ite(id(pwr.stat.drop, " == \"pwr.anova.test\""),
-    echo("\trk.print(\"Interpretation of effect size <strong>f</strong> (according to Cohen):\")\n",
-      "\trk.results(data.frame(small=0.1, medium=0.25, large=0.4))\n")
+    helper.make.effect.size.legend ("f", "0.1", "0.25", "0.4")
   ),
   ite(id(pwr.stat.drop, " == \"pwr.chisq.test\""),
-    echo("\trk.print(\"Interpretation of effect size <strong>w</strong> (according to Cohen):\")\n",
-      "\trk.results(data.frame(small=0.1, medium=0.3, large=0.5))\n")
+    helper.make.effect.size.legend ("w", "0.1", "0.3", "0.5")
   ),
   ite(id(pwr.stat.drop, " == \"pwr.p.test\""),
-    echo("\trk.print(\"Interpretation of effect size <strong>h</strong> (according to Cohen):\")\n",
-      "\trk.results(data.frame(small=0.2, medium=0.5, large=0.8))\n")
+    helper.make.effect.size.legend ("h", "0.2", "0.5", "0.8")
   )
 )
 
@@ -530,7 +535,7 @@ pwr.rkh.related <- rk.rkh.related(rk.rkh.link ("pwr", text="Description of the R
 pwr.plugin.dir <<- rk.plugin.skeleton(
   about.info,
   path=output.dir,
-  guess.getter=guess.getter,
+  guess.getter=TRUE,
   xml=list(
       dialog=pwr.full.dialog,
       logic=lgc.sect.pwr
@@ -553,5 +558,6 @@ pwr.plugin.dir <<- rk.plugin.skeleton(
 # edit=TRUE,
   load=TRUE,
 # show=TRUE,
-  hints=FALSE)
+  hints=FALSE,
+  internal=TRUE)
 })
diff --git a/tests/analysis_plugins/power_analysis.rkcommands.R b/tests/analysis_plugins/power_analysis.rkcommands.R
index 38c6113..4d5e4d5 100644
--- a/tests/analysis_plugins/power_analysis.rkcommands.R
+++ b/tests/analysis_plugins/power_analysis.rkcommands.R
@@ -18,7 +18,7 @@ require(pwr)
 
 	# Prepare printout
 	note <- pwr.result[["note"]]
-	parameters <- list("Target measure"="Power")
+	parameters <- list("Parameter to determine"="Power of test")
 	if(!is.null(pwr.result[["alternative"]])){
 		parameters[["alternative"]] <- pwr.result[["alternative"]]
 	}
@@ -30,11 +30,11 @@ require(pwr)
 
 	rk.results(pwr.result)
 	if(!is.null(note)){
-		rk.print(paste("<strong>Note:</strong> ", note))
+		rk.print(paste("<strong>Note:</strong>", note))
 	}
 
 	rk.print("Interpretation of effect size <strong>d</strong> (according to Cohen):")
-	rk.results(data.frame(small=0.2, medium=0.5, large=0.8))
+	rk.results(data.frame("small"=0.2, "medium"=0.5, "large"=0.8))
 })
 local({
 ## Prepare
@@ -57,7 +57,7 @@ require(pwr)
 
 	# Prepare printout
 	note <- pwr.result[["note"]]
-	parameters <- list("Target measure"="Power")
+	parameters <- list("Parameter to determine"="Power of test")
 	if(!is.null(pwr.result[["alternative"]])){
 		parameters[["alternative"]] <- pwr.result[["alternative"]]
 	}
@@ -69,11 +69,11 @@ require(pwr)
 
 	rk.results(pwr.result)
 	if(!is.null(note)){
-		rk.print(paste("<strong>Note:</strong> ", note))
+		rk.print(paste("<strong>Note:</strong>", note))
 	}
 
 	rk.print("Interpretation of effect size <strong>d</strong> (according to Cohen):")
-	rk.results(data.frame(small=0.2, medium=0.5, large=0.8))
+	rk.results(data.frame("small"=0.2, "medium"=0.5, "large"=0.8))
 })
 local({
 ## Prepare
@@ -95,7 +95,7 @@ require(pwr)
 
 	# Prepare printout
 	note <- pwr.result[["note"]]
-	parameters <- list("Target measure"="Sample size")
+	parameters <- list("Parameter to determine"="Sample size")
 	if(!is.null(pwr.result[["alternative"]])){
 		parameters[["alternative"]] <- pwr.result[["alternative"]]
 	}
@@ -107,11 +107,11 @@ require(pwr)
 
 	rk.results(pwr.result)
 	if(!is.null(note)){
-		rk.print(paste("<strong>Note:</strong> ", note))
+		rk.print(paste("<strong>Note:</strong>", note))
 	}
 
 	rk.print("Interpretation of effect size <strong>r</strong> (according to Cohen):")
-	rk.results(data.frame(small=0.1, medium=0.3, large=0.5))
+	rk.results(data.frame("small"=0.1, "medium"=0.3, "large"=0.5))
 })
 local({
 ## Prepare
@@ -136,7 +136,7 @@ require(pwr)
 
 	# Prepare printout
 	note <- pwr.result[["note"]]
-	parameters <- list("Target measure"="Significance level")
+	parameters <- list("Parameter to determine"="Significance level")
 	if(!is.null(pwr.result[["alternative"]])){
 		parameters[["alternative"]] <- pwr.result[["alternative"]]
 	}
@@ -148,11 +148,11 @@ require(pwr)
 
 	rk.results(pwr.result)
 	if(!is.null(note)){
-		rk.print(paste("<strong>Note:</strong> ", note))
+		rk.print(paste("<strong>Note:</strong>", note))
 	}
 
 	rk.print("Interpretation of effect size <strong>w</strong> (according to Cohen):")
-	rk.results(data.frame(small=0.1, medium=0.3, large=0.5))
+	rk.results(data.frame("small"=0.1, "medium"=0.3, "large"=0.5))
 })
 local({
 ## Prepare
@@ -177,7 +177,7 @@ require(pwr)
 
 	# Prepare printout
 	note <- pwr.result[["note"]]
-	parameters <- list("Target measure"="Significance level")
+	parameters <- list("Parameter to determine"="Significance level")
 	if(!is.null(pwr.result[["alternative"]])){
 		parameters[["alternative"]] <- pwr.result[["alternative"]]
 	}
@@ -189,11 +189,11 @@ require(pwr)
 
 	rk.results(pwr.result)
 	if(!is.null(note)){
-		rk.print(paste("<strong>Note:</strong> ", note))
+		rk.print(paste("<strong>Note:</strong>", note))
 	}
 
 	rk.print("Interpretation of effect size <strong>h</strong> (according to Cohen):")
-	rk.results(data.frame(small=0.2, medium=0.5, large=0.8))
+	rk.results(data.frame("small"=0.2, "medium"=0.5, "large"=0.8))
 })
 local({
 ## Prepare
@@ -217,7 +217,7 @@ require(pwr)
 
 	# Prepare printout
 	note <- pwr.result[["note"]]
-	parameters <- list("Target measure"="Significance level")
+	parameters <- list("Parameter to determine"="Significance level")
 	if(!is.null(pwr.result[["alternative"]])){
 		parameters[["alternative"]] <- pwr.result[["alternative"]]
 	}
@@ -229,11 +229,11 @@ require(pwr)
 
 	rk.results(pwr.result)
 	if(!is.null(note)){
-		rk.print(paste("<strong>Note:</strong> ", note))
+		rk.print(paste("<strong>Note:</strong>", note))
 	}
 
 	rk.print("Interpretation of effect size <strong>d</strong> (according to Cohen):")
-	rk.results(data.frame(small=0.2, medium=0.5, large=0.8))
+	rk.results(data.frame("small"=0.2, "medium"=0.5, "large"=0.8))
 })
 local({
 ## Prepare
@@ -257,7 +257,7 @@ require(pwr)
 
 	# Prepare printout
 	note <- pwr.result[["note"]]
-	parameters <- list("Target measure"="Parameter count")
+	parameters <- list("Parameter to determine"="Parameter count")
 	if(!is.null(pwr.result[["alternative"]])){
 		parameters[["alternative"]] <- pwr.result[["alternative"]]
 	}
@@ -269,9 +269,9 @@ require(pwr)
 
 	rk.results(pwr.result)
 	if(!is.null(note)){
-		rk.print(paste("<strong>Note:</strong> ", note))
+		rk.print(paste("<strong>Note:</strong>", note))
 	}
 
 	rk.print("Interpretation of effect size <strong>f<sup>2</sup></strong> (according to Cohen):")
-	rk.results(data.frame(small=0.02, medium=0.15, large=0.35))
+	rk.results(data.frame("small"=0.02, "medium"=0.15, "large"=0.35))
 })
diff --git a/tests/analysis_plugins/power_analysis.rkout b/tests/analysis_plugins/power_analysis.rkout
index 6e9c2d8..5a772ba 100644
--- a/tests/analysis_plugins/power_analysis.rkout
+++ b/tests/analysis_plugins/power_analysis.rkout
@@ -1,6 +1,6 @@
 <h1>Two-sample t test power calculation</h1>
 <h2>Parameters</h2>
-<ul><li>Target measure: Power</li>
+<ul><li>Parameter to determine: Power of test</li>
 <li>alternative: two.sided</li>
 </ul>
 DATE<br />
@@ -12,7 +12,7 @@ DATE<br />
 <tr><td>power    </td><td> 0.20785</td></tr>
 </table>
 
-<p class='character'><strong>Note:</strong>  n is number in *each* group</p>
+<p class='character'><strong>Note:</strong> n is number in *each* group</p>
 
 <p class='character'>Interpretation of effect size <strong>d</strong> (according to Cohen):</p>
 <table border="1">
@@ -21,7 +21,7 @@ DATE<br />
 </table>
 <h1>t test power calculation</h1>
 <h2>Parameters</h2>
-<ul><li>Target measure: Power</li>
+<ul><li>Parameter to determine: Power of test</li>
 <li>alternative: two.sided</li>
 </ul>
 DATE<br />
@@ -41,7 +41,7 @@ DATE<br />
 </table>
 <h1>approximate correlation power calculation (arctangh transformation)</h1>
 <h2>Parameters</h2>
-<ul><li>Target measure: Sample size</li>
+<ul><li>Parameter to determine: Sample size</li>
 <li>alternative: two.sided</li>
 </ul>
 DATE<br />
@@ -60,7 +60,7 @@ DATE<br />
 </table>
 <h1>Chi squared power calculation</h1>
 <h2>Parameters</h2>
-<ul><li>Target measure: Significance level</li>
+<ul><li>Parameter to determine: Significance level</li>
 </ul>
 DATE<br />
 <table border="1">
@@ -72,7 +72,7 @@ DATE<br />
 <tr><td>power    </td><td> 0.81000</td></tr>
 </table>
 
-<p class='character'><strong>Note:</strong>  N is the number of observations</p>
+<p class='character'><strong>Note:</strong> N is the number of observations</p>
 
 <p class='character'>Interpretation of effect size <strong>w</strong> (according to Cohen):</p>
 <table border="1">
@@ -81,7 +81,7 @@ DATE<br />
 </table>
 <h1>Difference of proportion power calculation for binomial distribution (arcsine transformation)</h1>
 <h2>Parameters</h2>
-<ul><li>Target measure: Significance level</li>
+<ul><li>Parameter to determine: Significance level</li>
 <li>alternative: greater</li>
 </ul>
 DATE<br />
@@ -93,7 +93,7 @@ DATE<br />
 <tr><td>power    </td><td> 0.81000</td></tr>
 </table>
 
-<p class='character'><strong>Note:</strong>  same sample sizes</p>
+<p class='character'><strong>Note:</strong> same sample sizes</p>
 
 <p class='character'>Interpretation of effect size <strong>h</strong> (according to Cohen):</p>
 <table border="1">
@@ -102,7 +102,7 @@ DATE<br />
 </table>
 <h1>Mean power calculation for normal distribution with known variance</h1>
 <h2>Parameters</h2>
-<ul><li>Target measure: Significance level</li>
+<ul><li>Parameter to determine: Significance level</li>
 <li>alternative: two.sided</li>
 </ul>
 DATE<br />
@@ -121,7 +121,7 @@ DATE<br />
 </table>
 <h1>Multiple regression power calculation</h1>
 <h2>Parameters</h2>
-<ul><li>Target measure: Parameter count</li>
+<ul><li>Parameter to determine: Parameter count</li>
 </ul>
 DATE<br />
 <table border="1">


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
rkward-cvs mailing list
rkward-cvs at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-cvs


More information about the rkward-tracker mailing list