Commit 4f9d25fa authored by Thomas Friedrichsmeier's avatar Thomas Friedrichsmeier
Browse files

Start adding i18n() to IRT plugins (not done yet: plots)

parent ccf4c123
......@@ -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');
}
}
......@@ -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');
}
}
......@@ -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');
}
}
......@@ -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');
}
}
......@@ -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');
}
}
......@@ -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');
}
}
......@@ -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');
}
}
......@@ -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');
}
}
......@@ -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');
}
}
......@@ -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');
}
}
......@@ -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');
}
......@@ -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');
}
}
......@@ -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');
......
......@@ -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 (&gt;X^2)"=format(round(itemfit.res$p.values, digits=3), nsmall=3)))\n');
}
......@@ -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 (&lt;Lz)"=round(c(personfit.res$p.values), digits=3)))\n');
}
......@@ -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');
}
}
......@@ -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)
......
<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>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment