[rkward-cvs] [rkward] /: Start adding i18n() to IRT plugins (not done yet: plots)
Thomas Friedrichsmeier
thomas.friedrichsmeier at ruhr-uni-bochum.de
Sat Jan 10 19:56:26 UTC 2015
Git commit 4f9d25fa6b1d8913bf437ebe69e8020c2768db04 by Thomas Friedrichsmeier.
Committed on 10/01/2015 at 19:54.
Pushed by tfry into branch 'master'.
Start adding i18n() to IRT plugins (not done yet: plots)
M +5 -5 rkward/plugins/analysis/irt/dichotomous/par_est_2pl.js
M +5 -5 rkward/plugins/analysis/irt/dichotomous/par_est_3pl.js
M +6 -6 rkward/plugins/analysis/irt/dichotomous/par_est_lltm.js
M +5 -5 rkward/plugins/analysis/irt/dichotomous/par_est_rasch.js
M +5 -5 rkward/plugins/analysis/irt/polytomous/par_est_gpcm.js
M +5 -5 rkward/plugins/analysis/irt/polytomous/par_est_grm.js
M +6 -6 rkward/plugins/analysis/irt/polytomous/par_est_lpcm.js
M +6 -6 rkward/plugins/analysis/irt/polytomous/par_est_lrsm.js
M +6 -6 rkward/plugins/analysis/irt/polytomous/par_est_pcm.js
M +6 -6 rkward/plugins/analysis/irt/polytomous/par_est_rsm.js
M +3 -3 rkward/plugins/analysis/irt/tests/eRm_waldtest.js
M +6 -7 rkward/plugins/analysis/irt/tests/ltm_cronbach_alpha.js
M +1 -1 rkward/plugins/analysis/irt/tests/ltm_gof_rasch.js
M +6 -6 rkward/plugins/analysis/irt/tests/ltm_item_fit.js
M +3 -3 rkward/plugins/analysis/irt/tests/ltm_person_fit.js
M +10 -10 rkward/plugins/analysis/irt/tests/ltm_unidimensional.js
M +2 -2 tests/item_response_theory/Cronbach_alpha.rkcommands.R
M +6 -4 tests/item_response_theory/Cronbach_alpha.rkout
http://commits.kde.org/rkward/4f9d25fa6b1d8913bf437ebe69e8020c2768db04
diff --git a/rkward/plugins/analysis/irt/dichotomous/par_est_2pl.js b/rkward/plugins/analysis/irt/dichotomous/par_est_2pl.js
index 6845f5f..3e155cb 100644
--- a/rkward/plugins/analysis/irt/dichotomous/par_est_2pl.js
+++ b/rkward/plugins/analysis/irt/dichotomous/par_est_2pl.js
@@ -50,15 +50,15 @@ function printout () {
var save = getValue("save_name.active");
var save_name = getValue("save_name");
- echo ('rk.header ("2PL parameter estimation")\n');
- echo ('rk.print ("Call:")\n');
+ echo ('rk.header ('+ i18n ("2PL parameter estimation") + ')\n');
+ echo ('rk.print (' + i18n ("Call:") + ')\n');
echo ('rk.print.literal (deparse(estimates.2pl$call, width.cutoff=500))\n');
- echo ('rk.header ("Coefficients:", level=4)\n');
+ echo ('rk.header (' + i18n ("Coefficients:") + ', level=4)\n');
echo ('rk.print (coef(estimates.2pl))\n');
- echo ('rk.print (paste("Log-likelihood value at convergence:",round(estimates.2pl$log.Lik, digits=1)))\n');
+ echo ('rk.print (paste(' + i18n ("Log-likelihood value at convergence:") + ',round(estimates.2pl$log.Lik, digits=1)))\n');
// check if results are to be saved:
if (save && save_name) {
- echo ('# keep results in current workspace\n');
+ comment ('keep results in current workspace');
echo ('.GlobalEnv$' + save_name + ' <- estimates.2pl\n');
}
}
diff --git a/rkward/plugins/analysis/irt/dichotomous/par_est_3pl.js b/rkward/plugins/analysis/irt/dichotomous/par_est_3pl.js
index e85e164..885860a 100644
--- a/rkward/plugins/analysis/irt/dichotomous/par_est_3pl.js
+++ b/rkward/plugins/analysis/irt/dichotomous/par_est_3pl.js
@@ -56,15 +56,15 @@ function printout () {
var save = getValue("save_name.active");
var save_name = getValue("save_name");
- echo ('rk.header ("3PL parameter estimation")\n');
- echo ('rk.print ("Call:")\n');
+ echo ('rk.header (' + i18n ("3PL parameter estimation") + ')\n');
+ echo ('rk.print (' + i18n ("Call:") + ')\n');
echo ('rk.print.literal (deparse(estimates.3pl$call, width.cutoff=500))\n');
- echo ('rk.header ("Coefficients:", level=4)\n');
+ echo ('rk.header (' + i18n ("Coefficients:") + ', level=4)\n');
echo ('rk.print (coef(estimates.3pl))\n');
- echo ('rk.print (paste("Log-likelihood value at convergence:",round(estimates.3pl$log.Lik, digits=1)))\n');
+ echo ('rk.print (paste(' + i18n ("Log-likelihood value at convergence:") + ',round(estimates.3pl$log.Lik, digits=1)))\n');
// check if results are to be saved:
if (save && save_name) {
- echo ('# keep results in current workspace\n');
+ comment ('keep results in current workspace');
echo ('.GlobalEnv$' + save_name + ' <- estimates.3pl\n');
}
}
diff --git a/rkward/plugins/analysis/irt/dichotomous/par_est_lltm.js b/rkward/plugins/analysis/irt/dichotomous/par_est_lltm.js
index a197a01..e03fb3b 100644
--- a/rkward/plugins/analysis/irt/dichotomous/par_est_lltm.js
+++ b/rkward/plugins/analysis/irt/dichotomous/par_est_lltm.js
@@ -31,16 +31,16 @@ function printout () {
var save = getValue("save_name.active");
var save_name = getValue("save_name");
- echo ('rk.header ("LLTM parameter estimation")\n');
- echo ('rk.print ("Call:")\n');
+ echo ('rk.header (' + i18n ("LLTM parameter estimation") + ')\n');
+ echo ('rk.print (' + i18n ("Call:") + ')\n');
echo ('rk.print.literal (deparse(estimates.lltm$call, width.cutoff=500))\n');
- echo ('rk.header ("Coefficients:", level=4)\n');
+ echo ('rk.header (' + i18n ("Coefficients:") + ', level=4)\n');
echo ('rk.print(t(rbind(Eta=estimates.lltm$etapar,StdErr=estimates.lltm$se.eta)))\n');
- echo ('rk.print (paste("Conditional log-likelihood:",round(estimates.lltm$loglik, digits=1),\n');
- echo ('"<br />Number of iterations:",estimates.lltm$iter,"<br />Number of parameters:",estimates.lltm$npar))\n');
+ echo ('rk.print (paste(' + i18n ("Conditional log-likelihood:") + ',round(estimates.lltm$loglik, digits=1),\n');
+ echo (i18n ("<br />Number of iterations:") + ',estimates.lltm$iter,' + i18n ("<br />Number of parameters:") + ',estimates.lltm$npar))\n');
// check if results are to be saved:
if (save && save_name) {
- echo ('# keep results in current workspace\n');
+ comment ('keep results in current workspace');
echo ('.GlobalEnv$' + save_name + ' <- estimates.lltm\n');
}
}
diff --git a/rkward/plugins/analysis/irt/dichotomous/par_est_rasch.js b/rkward/plugins/analysis/irt/dichotomous/par_est_rasch.js
index 8292af3..4abc5aa 100644
--- a/rkward/plugins/analysis/irt/dichotomous/par_est_rasch.js
+++ b/rkward/plugins/analysis/irt/dichotomous/par_est_rasch.js
@@ -46,15 +46,15 @@ function printout () {
var save_name = getValue("save_name");
var irtparam = getValue("irtparam");
- echo ('rk.header ("Rasch parameter estimation")\n');
- echo ('rk.print ("Call:")\n');
+ echo ('rk.header (' + i18n ("Rasch parameter estimation") + ')\n');
+ echo ('rk.print (' + i18n ("Call:") + ')\n');
echo ('rk.print.literal (deparse(estimates.rasch$call, width.cutoff=500))\n');
- echo ('rk.header ("Coefficients:", level=4)\n');
+ echo ('rk.header (' + i18n ("Coefficients:") + ', level=4)\n');
echo ('rk.print (coef(estimates.rasch))\n');
- echo ('rk.print (paste("Log-likelihood value at convergence:",round(estimates.rasch$log.Lik, digits=1)))\n');
+ echo ('rk.print (paste(' + i18n ("Log-likelihood value at convergence:") + ',round(estimates.rasch$log.Lik, digits=1)))\n');
// check if results are to be saved:
if (save && save_name) {
- echo ('# keep results in current workspace\n');
+ comment ('keep results in current workspace');
echo ('.GlobalEnv$' + save_name + ' <- estimates.rasch\n');
}
}
diff --git a/rkward/plugins/analysis/irt/polytomous/par_est_gpcm.js b/rkward/plugins/analysis/irt/polytomous/par_est_gpcm.js
index 734b510..3e87a6d 100644
--- a/rkward/plugins/analysis/irt/polytomous/par_est_gpcm.js
+++ b/rkward/plugins/analysis/irt/polytomous/par_est_gpcm.js
@@ -65,15 +65,15 @@ function printout () {
var save = getValue("save_name.active");
var save_name = getValue("save_name");
- echo ('rk.header ("GPCM parameter estimation")\n');
- echo ('rk.print ("Call:")\n');
+ echo ('rk.header (' + i18n ("GPCM parameter estimation") + ')\n');
+ echo ('rk.print (' + i18n ("Call:") + ')\n');
echo ('rk.print.literal (deparse(estimates.gpcm$call, width.cutoff=500))\n');
- echo ('rk.header ("Coefficients:", level=4)\n');
+ echo ('rk.header (' + i18n ("Coefficients:") + ', level=4)\n');
echo ('rk.print (coef(estimates.gpcm))\n');
- echo ('rk.print (paste("Log-likelihood value at convergence:",round(estimates.gpcm$log.Lik, digits=1)))\n');
+ echo ('rk.print (paste(' + i18n ("Log-likelihood value at convergence:") + ',round(estimates.gpcm$log.Lik, digits=1)))\n');
// check if results are to be saved:
if (save && save_name) {
- echo ('# keep results in current workspace\n');
+ comment ('keep results in current workspace');
echo ('.GlobalEnv$' + save_name + ' <- estimates.gpcm\n');
}
}
diff --git a/rkward/plugins/analysis/irt/polytomous/par_est_grm.js b/rkward/plugins/analysis/irt/polytomous/par_est_grm.js
index 3797a77..2fa13e3 100644
--- a/rkward/plugins/analysis/irt/polytomous/par_est_grm.js
+++ b/rkward/plugins/analysis/irt/polytomous/par_est_grm.js
@@ -50,15 +50,15 @@ function printout () {
var save = getValue("save_name.active");
var save_name = getValue("save_name");
- echo ('rk.header ("GRM parameter estimation")\n');
- echo ('rk.print ("Call:")\n');
+ echo ('rk.header (' + i18n ("GRM parameter estimation") + ')\n');
+ echo ('rk.print (' + i18n ("Call:") + ')\n');
echo ('rk.print.literal (deparse(estimates.grm$call, width.cutoff=500))\n');
- echo ('rk.header ("Coefficients:", level=4)\n');
+ echo ('rk.header (' + i18n ("Coefficients:") + ', level=4)\n');
echo ('rk.print (coef(estimates.grm))\n');
- echo ('rk.print (paste("Log-likelihood value at convergence:",round(estimates.grm$log.Lik, digits=1)))\n');
+ echo ('rk.print (paste(' + i18n ("Log-likelihood value at convergence:") + ',round(estimates.grm$log.Lik, digits=1)))\n');
// check if results are to be saved:
if (save && save_name) {
- echo ('# keep results in current workspace\n');
+ comment ('keep results in current workspace');
echo ('.GlobalEnv$' + save_name + ' <- estimates.grm\n');
}
}
diff --git a/rkward/plugins/analysis/irt/polytomous/par_est_lpcm.js b/rkward/plugins/analysis/irt/polytomous/par_est_lpcm.js
index f38fb5f..bec45d3 100644
--- a/rkward/plugins/analysis/irt/polytomous/par_est_lpcm.js
+++ b/rkward/plugins/analysis/irt/polytomous/par_est_lpcm.js
@@ -31,16 +31,16 @@ function printout () {
var save = getValue("save_name.active");
var save_name = getValue("save_name");
- echo ('rk.header ("LPCM parameter estimation")\n');
- echo ('rk.print ("Call:")\n');
+ echo ('rk.header (' + i18n ("LPCM parameter estimation") + ')\n');
+ echo ('rk.print (' + i18n ("Call:") + ')\n');
echo ('rk.print.literal (deparse(estimates.lpcm$call, width.cutoff=500))\n');
- echo ('rk.header ("Coefficients:", level=4)\n');
+ echo ('rk.header (' + i18n ("Coefficients:") + ', level=4)\n');
echo ('rk.print(t(rbind(Eta=estimates.lpcm$etapar,StdErr=estimates.lpcm$se.eta)))\n');
- echo ('rk.print (paste("Conditional log-likelihood:",round(estimates.lpcm$loglik, digits=1),\n');
- echo ('"<br />Number of iterations:",estimates.lpcm$iter,"<br />Number of parameters:",estimates.lpcm$npar))\n');
+ echo ('rk.print (paste(' + i18n ("Conditional log-likelihood:") + ',round(estimates.lpcm$loglik, digits=1),\n');
+ echo (i18n ("<br />Number of iterations:") + ',estimates.lpcm$iter,' + i18n ("<br />Number of parameters:") + ',estimates.lpcm$npar))\n');
// check if results are to be saved:
if (save && save_name) {
- echo ('# keep results in current workspace\n');
+ comment ('keep results in current workspace');
echo ('.GlobalEnv$' + save_name + ' <- estimates.lpcm\n');
}
}
diff --git a/rkward/plugins/analysis/irt/polytomous/par_est_lrsm.js b/rkward/plugins/analysis/irt/polytomous/par_est_lrsm.js
index ced71bb..6619448 100644
--- a/rkward/plugins/analysis/irt/polytomous/par_est_lrsm.js
+++ b/rkward/plugins/analysis/irt/polytomous/par_est_lrsm.js
@@ -31,16 +31,16 @@ function printout () {
var save = getValue("save_name.active");
var save_name = getValue("save_name");
- echo ('rk.header ("LRSM parameter estimation")\n');
- echo ('rk.print ("Call:")\n');
+ echo ('rk.header (' + i18n ("LRSM parameter estimation") + ')\n');
+ echo ('rk.print (' + i18n ("Call:") + ')\n');
echo ('rk.print.literal (deparse(estimates.lrsm$call, width.cutoff=500))\n');
- echo ('rk.header ("Coefficients:", level=4)\n');
+ echo ('rk.header (' + i18n ("Coefficients:") + ', level=4)\n');
echo ('rk.print(t(rbind(Eta=estimates.lrsm$etapar,StdErr=estimates.lrsm$se.eta)))\n');
- echo ('rk.print (paste("Conditional log-likelihood:",round(estimates.lrsm$loglik, digits=1),\n');
- echo ('"<br />Number of iterations:",estimates.lrsm$iter,"<br />Number of parameters:",estimates.lrsm$npar))\n');
+ echo ('rk.print (paste(' + i18n ("Conditional log-likelihood:") + ',round(estimates.lrsm$loglik, digits=1),\n');
+ echo (i18n ("<br />Number of iterations:") + ',estimates.lrsm$iter,' + i18n ("<br />Number of parameters:") + ',estimates.lrsm$npar))\n');
// check if results are to be saved:
if (save && save_name) {
- echo ('# keep results in current workspace\n');
+ comment ('keep results in current workspace');
echo ('.GlobalEnv$' + save_name + ' <- estimates.lrsm\n');
}
}
diff --git a/rkward/plugins/analysis/irt/polytomous/par_est_pcm.js b/rkward/plugins/analysis/irt/polytomous/par_est_pcm.js
index 95381dd..a767710 100644
--- a/rkward/plugins/analysis/irt/polytomous/par_est_pcm.js
+++ b/rkward/plugins/analysis/irt/polytomous/par_est_pcm.js
@@ -26,16 +26,16 @@ function printout () {
var save = getValue("save_name.active");
var save_name = getValue("save_name");
- echo ('rk.header ("PCM parameter estimation")\n');
- echo ('rk.print ("Call:")\n');
+ echo ('rk.header (' + i18n ("PCM parameter estimation") + ')\n');
+ echo ('rk.print (' + i18n ("Call:") + ')\n');
echo ('rk.print.literal (deparse(estimates.pcm$call, width.cutoff=500))\n');
- echo ('rk.header ("Coefficients:", level=4)\n');
+ echo ('rk.header (' + i18n ("Coefficients:") + ', level=4)\n');
echo ('rk.print(t(rbind(Eta=estimates.pcm$etapar,StdErr=estimates.pcm$se.eta)))\n');
- echo ('rk.print (paste("Conditional log-likelihood:",round(estimates.pcm$loglik, digits=1),\n');
- echo ('"<br />Number of iterations:",estimates.pcm$iter,"<br />Number of parameters:",estimates.pcm$npar))\n');
+ echo ('rk.print (paste(' + i18n ("Conditional log-likelihood:") + ',round(estimates.pcm$loglik, digits=1),\n');
+ echo (i18n ("<br />Number of iterations:") + ',estimates.pcm$iter,' + i18n ("<br />Number of parameters:") + ',estimates.pcm$npar))\n');
// check if results are to be saved:
if (save && save_name) {
- echo ('# keep results in current workspace\n');
+ comment ('keep results in current workspace');
echo ('.GlobalEnv$' + save_name + ' <- estimates.pcm\n');
}
}
diff --git a/rkward/plugins/analysis/irt/polytomous/par_est_rsm.js b/rkward/plugins/analysis/irt/polytomous/par_est_rsm.js
index 2394f35..948d10a 100644
--- a/rkward/plugins/analysis/irt/polytomous/par_est_rsm.js
+++ b/rkward/plugins/analysis/irt/polytomous/par_est_rsm.js
@@ -26,16 +26,16 @@ function printout () {
var save = getValue("save_name.active");
var save_name = getValue("save_name");
- echo ('rk.header ("RSM parameter estimation")\n');
- echo ('rk.print ("Call:")\n');
+ echo ('rk.header (' + i18n ("RSM parameter estimation") + ')\n');
+ echo ('rk.print (' + i18n ("Call:") + ')\n');
echo ('rk.print.literal (deparse(estimates.rsm$call, width.cutoff=500))\n');
- echo ('rk.header ("Coefficients:", level=4)\n');
+ echo ('rk.header (' + i18n ("Coefficients:") + ', level=4)\n');
echo ('rk.print(t(rbind(Eta=estimates.rsm$etapar,StdErr=estimates.rsm$se.eta)))\n');
- echo ('rk.print (paste("Conditional log-likelihood:",round(estimates.rsm$loglik, digits=1),\n');
- echo ('"<br />Number of iterations:",estimates.rsm$iter,"<br />Number of parameters:",estimates.rsm$npar))\n');
+ echo ('rk.print (paste(' + i18n ("Conditional log-likelihood:") + ',round(estimates.rsm$loglik, digits=1),\n');
+ echo (i18n ("<br />Number of iterations:") + ',estimates.rsm$iter,' + i18n ("<br />Number of parameters:") + ',estimates.rsm$npar))\n');
// check if results are to be saved:
if (save && save_name) {
- echo ('# keep results in current workspace\n');
+ comment ('keep results in current workspace');
echo ('.GlobalEnv$' + save_name + ' <- estimates.rsm\n');
}
}
diff --git a/rkward/plugins/analysis/irt/tests/eRm_waldtest.js b/rkward/plugins/analysis/irt/tests/eRm_waldtest.js
index 3389157..9e4e49d 100644
--- a/rkward/plugins/analysis/irt/tests/eRm_waldtest.js
+++ b/rkward/plugins/analysis/irt/tests/eRm_waldtest.js
@@ -19,9 +19,9 @@ function calculate () {
}
function printout () {
- echo ('rk.header ("Wald test (' + getValue("x") + ')")\n');
- echo ('rk.print ("Call:")\n');
+ echo ('rk.header (' + i18n ("Wald test (%1)", getValue ("x")) + ')\n');
+ echo ('rk.print (' + i18n ("Call:") + ')\n');
echo ('rk.print.literal (deparse(waldtest.res$call, width.cutoff=500))\n');
- echo ('rk.header ("Wald test on item level (z-values):", level=4)\n');
+ echo ('rk.header (' + i18n ("Wald test on item level (z-values):") + ', level=4)\n');
echo ('rk.print(waldtest.res$coef.table)\n');
}
diff --git a/rkward/plugins/analysis/irt/tests/ltm_cronbach_alpha.js b/rkward/plugins/analysis/irt/tests/ltm_cronbach_alpha.js
index 4605608..6dd5fa8 100644
--- a/rkward/plugins/analysis/irt/tests/ltm_cronbach_alpha.js
+++ b/rkward/plugins/analysis/irt/tests/ltm_cronbach_alpha.js
@@ -65,18 +65,17 @@ function printout () {
if (inp_items)
inp_items = inp_items.replace(/\n/g,', ').replace(/(\w*)\[\["|"\]\]/g, '');
- echo ('rk.header ("Cronbach\'s alpha")\n');
- echo ('rk.print("for the \'' + getValue("x") + '\' data-set');
+ header = new Header (i18n ("Cronbach\'s alpha")).add (i18n ("Dataset"), getValue ("x"));
if (chk_select && inp_items)
- echo (" (subset: "+inp_items+")");
- echo ('")\n');
- echo ('rk.print(paste("Items:",cronalpha.res$p,"<br />Sample units:",cronalpha.res$n,"<br /><strong>alpha:",round(cronalpha.res$alpha, digits=2),"</strong>');
+ header.add (i18n ("Subset"), inp_items);
+ header.print ();
+ echo ('rk.print(paste(' + i18n ("Items:") + ',cronalpha.res$p,' + i18n ("<br />Sample units:") + ',cronalpha.res$n,"<br /><strong>alpha:",round(cronalpha.res$alpha, digits=2),"</strong>');
if (chk_standard) echo(" (standardized)");
echo ('"))\n');
- echo ('rk.print("Effects on alpha if items are removed:")\n');
+ echo ('rk.print(' + i18n ("Effects on alpha if items are removed:") + ')\n');
echo ('rk.print(descript.res$alpha)\n');
if (chk_bsci) {
- echo ('rk.print("' + (spin_ci * 100)+"%" + ' Confidence interval:")\n');
+ echo ('rk.print(' + i18n ("%1% Confidence interval:", spin_ci * 100) + ')\n');
echo ('rk.print(cronalpha.res$ci)\n');
}
}
diff --git a/rkward/plugins/analysis/irt/tests/ltm_gof_rasch.js b/rkward/plugins/analysis/irt/tests/ltm_gof_rasch.js
index d90fb6b..0e1e9e7 100644
--- a/rkward/plugins/analysis/irt/tests/ltm_gof_rasch.js
+++ b/rkward/plugins/analysis/irt/tests/ltm_gof_rasch.js
@@ -14,7 +14,7 @@ function calculate () {
}
function printout () {
- echo ('rk.header ("Goodness of Fit for Rasch Models (' + getValue("x") + ')")\n');
+ echo ('rk.header (' + i18n ("Goodness of Fit for Rasch Models (%1)", getValue ("x")) + ')\n');
echo ('rk.print ("Call:")\n');
echo ('rk.print.literal (deparse(GoFRasch.res$call, width.cutoff=500))\n');
echo ('rk.header ("Parametric Bootstrap test:", level=4)\n');
diff --git a/rkward/plugins/analysis/irt/tests/ltm_item_fit.js b/rkward/plugins/analysis/irt/tests/ltm_item_fit.js
index 0783f20..e951a79 100644
--- a/rkward/plugins/analysis/irt/tests/ltm_item_fit.js
+++ b/rkward/plugins/analysis/irt/tests/ltm_item_fit.js
@@ -32,13 +32,13 @@ function calculate () {
function printout () {
var rad_pvalue = getValue("rad_pvalue");
- echo ('rk.header ("Item-fit statistics (' + getValue("x") + ')")\n');
- echo ('rk.print ("Call:")\n');
+ echo ('rk.header (' + i18n ("Item-fit statistics (%1)", getValue("x")) + ')\n');
+ echo ('rk.print (' + i18n ("Call:") + ')\n');
echo ('rk.print.literal (deparse(itemfit.res$call, width.cutoff=500))\n');
- echo ('rk.print ("Alternative: Items do not fit the model")\n');
- echo ('rk.print (paste("Ability Categories:", itemfit.res$G))\n');
+ echo ('rk.print (' + i18n ("Alternative: Items do not fit the model") + ')\n');
+ echo ('rk.print (paste(' + i18n ("Ability Categories:") + ', itemfit.res$G))\n');
if (rad_pvalue == "montecarlo")
- echo ('rk.print (paste("Monte Carlo samples:", itemfit.res$B))\n');
- echo ('rk.header ("Item-Fit Statistics and P-values:", level=4)\n');
+ echo ('rk.print (paste(' + i18n ("Monte Carlo samples:") + ', itemfit.res$B))\n');
+ echo ('rk.header (' + i18n ("Item-Fit Statistics and P-values:") + ', level=4)\n');
echo ('rk.print(cbind("X^2"=round(itemfit.res$Tobs, digits=3), "Pr (>X^2)"=format(round(itemfit.res$p.values, digits=3), nsmall=3)))\n');
}
diff --git a/rkward/plugins/analysis/irt/tests/ltm_person_fit.js b/rkward/plugins/analysis/irt/tests/ltm_person_fit.js
index 645d6b6..4655d76 100644
--- a/rkward/plugins/analysis/irt/tests/ltm_person_fit.js
+++ b/rkward/plugins/analysis/irt/tests/ltm_person_fit.js
@@ -31,9 +31,9 @@ function calculate () {
}
function printout () {
- echo ('rk.header ("Person-fit statistics (' + getValue("x") + ')")\n');
- echo ('rk.print ("Call:")\n');
+ echo ('rk.header (' + i18n ("Person-fit statistics (%1)", getValue("x")) + ')\n');
+ echo ('rk.print (' + i18n ("Call:") + ')\n');
echo ('rk.print.literal (deparse(personfit.res$call, width.cutoff=500))\n');
- echo ('rk.header ("Response patterns, person-fit statistics (L0, Lz) and probabilities for each response pattern (Pr):", level=4)\n');
+ echo ('rk.header (' + i18n ("Response patterns, person-fit statistics (L0, Lz) and probabilities for each response pattern (Pr):") + ', level=4)\n');
echo ('rk.print(cbind(format(personfit.res$resp.patterns, nsmall=0), round(personfit.res$Tobs, digits=3), "Pr (<Lz)"=round(c(personfit.res$p.values), digits=3)))\n');
}
diff --git a/rkward/plugins/analysis/irt/tests/ltm_unidimensional.js b/rkward/plugins/analysis/irt/tests/ltm_unidimensional.js
index 79f4eaa..c168724 100644
--- a/rkward/plugins/analysis/irt/tests/ltm_unidimensional.js
+++ b/rkward/plugins/analysis/irt/tests/ltm_unidimensional.js
@@ -17,20 +17,20 @@ function printout () {
var save = getValue("save_name.active");
var save_name = getValue("save_name");
- echo ('rk.header ("Unidimensionality check (' + getValue("x") + ')")\n');
- echo ('rk.print ("Call:")\n');
+ echo ('rk.header (' + i18n ("Unidimensionality check (%1)", getValue("x")) + ')\n');
+ echo ('rk.print (' + i18n ("Call:") + ')\n');
echo ('rk.print.literal (deparse(unidim.res$call, width.cutoff=500))\n');
- echo ('rk.header ("Matrix of tertachoric correlations:", level=4)\n');
+ echo ('rk.header (' + i18n ("Matrix of tertachoric correlations:") + ', level=4)\n');
echo ('rk.print (unidim.res$Rho)\n');
- echo ('rk.header ("Unidimensionality Check using Modified Parallel Analysis:", level=4)\n');
- echo ('rk.print ("Alternative hypothesis: <em>The second eigenvalue of the observed data is substantially larger than the second eigenvalue of data under the assumed IRT model</em>")\n');
- echo ('rk.print (paste("Second eigenvalue in the observed data:", round(unidim.res$Tobs[2], digits=3)))\n');
- echo ('rk.print (paste("Average of second eigenvalues in Monte Carlo samples:", round(mean(unidim.res$T.boot[,2]), digits=3)))\n');
- echo ('rk.print (paste("Monte Carlo samples:", dim(unidim.res$T.boot)[1]))\n');
- echo ('rk.print (paste("p-value:", round(unidim.res$p.value, digits=3)))\n');
+ echo ('rk.header (' + i18n ("Unidimensionality Check using Modified Parallel Analysis:") + ', level=4)\n');
+ echo ('rk.print (' + i18n ("Alternative hypothesis: <em>The second eigenvalue of the observed data is substantially larger than the second eigenvalue of data under the assumed IRT model</em>") + ')\n');
+ echo ('rk.print (paste(' + i18n ("Second eigenvalue in the observed data:") + ', round(unidim.res$Tobs[2], digits=3)))\n');
+ echo ('rk.print (paste(' + i18n ("Average of second eigenvalues in Monte Carlo samples:") + ', round(mean(unidim.res$T.boot[,2]), digits=3)))\n');
+ echo ('rk.print (paste(' + i18n ("Monte Carlo samples:") + ', dim(unidim.res$T.boot)[1]))\n');
+ echo ('rk.print (paste(' + i18n ("p-value:") + ', round(unidim.res$p.value, digits=3)))\n');
// check if results are to be saved:
if (save && save_name) {
- echo ('# keep results in current workspace\n');
+ comment ('keep results in current workspace');
echo ('.GlobalEnv$' + save_name + ' <- unidim.res\n');
}
}
diff --git a/tests/item_response_theory/Cronbach_alpha.rkcommands.R b/tests/item_response_theory/Cronbach_alpha.rkcommands.R
index c56246e..64c84d1 100644
--- a/tests/item_response_theory/Cronbach_alpha.rkcommands.R
+++ b/tests/item_response_theory/Cronbach_alpha.rkcommands.R
@@ -5,8 +5,8 @@ require(ltm)
cronalpha.res <- cronbach.alpha(subset(LSAT, select=c("Item 1", "Item 2", "Item 3", "Item 4", "Item 5")), CI=TRUE)
descript.res <- descript(subset(LSAT, select=c("Item 1", "Item 2", "Item 3", "Item 4", "Item 5")), chi.squared=FALSE, B=1000)
## Print result
-rk.header ("Cronbach's alpha")
-rk.print("for the 'LSAT' data-set (subset: Item 1, Item 2, Item 3, Item 4, Item 5)")
+rk.header ("Cronbach's alpha", parameters=list("Dataset"="LSAT",
+ "Subset"="Item 1, Item 2, Item 3, Item 4, Item 5"))
rk.print(paste("Items:",cronalpha.res$p,"<br />Sample units:",cronalpha.res$n,"<br /><strong>alpha:",round(cronalpha.res$alpha, digits=2),"</strong>"))
rk.print("Effects on alpha if items are removed:")
rk.print(descript.res$alpha)
diff --git a/tests/item_response_theory/Cronbach_alpha.rkout b/tests/item_response_theory/Cronbach_alpha.rkout
index 9c4e4b4..c626323 100644
--- a/tests/item_response_theory/Cronbach_alpha.rkout
+++ b/tests/item_response_theory/Cronbach_alpha.rkout
@@ -1,7 +1,9 @@
<h1>Cronbach's alpha</h1>
-DATE<br>
-
-<p class='character'>for the 'LSAT' data-set (subset: Item 1, Item 2, Item 3, Item 4, Item 5)</p>
+<h2>Parameters</h2>
+<ul><li>Dataset: LSAT</li>
+<li>Subset: Item 1, Item 2, Item 3, Item 4, Item 5</li>
+</ul>
+DATE<br />
<p class='character'>Items: 5 <br />Sample units: 1000 <br /><strong>alpha: 0.29 </strong></p>
@@ -49,7 +51,7 @@ DATE<br>
<tr><td class=firstcolumn></td>
<td class=cellinside>0.22</td>
-<td class=cellinside>0.36</td></tr>
+<td class=cellinside>0.37</td></tr>
</tbody>
</table>
More information about the rkward-tracker
mailing list