<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!--P{margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Dear developers,<br>
</p>
<p><br>
</p>
<p>I tired to reproduce the confidence intervals for the Log Ratio for the keywords function in
<br>
</p>
<p>CQPweb 3.1.16 myself&nbsp;(in R) and failed. Subsequently, when trying to figure out the formula that is used from the source code (3.2.11), I found the following line in the file &quot;lib/keywords.inc.php&quot;:<br>
</p>
<p><br>
</p>
<p>$fragment_CIhalf = &quot;($Z_unit * SQRT( ($O12 / ($R1 * IF($O11 &gt; 0, $O11, 0.5))) &#43; ($O22 / ($R2 * IF($O11 &gt; 0, $O11, 0.5))) ))&quot;;<br>
</p>
<p><br>
</p>
<p>shouldn't that be: </p>
<p><br>
</p>
<p>$fragment_CIhalf = &quot;($Z_unit * SQRT( ($O12 / ($R1 * IF($O11 &gt; 0, $O11, 0.5))) &#43; ($O22 / ($R2 * IF($O21 &gt; 0, $O21, 0.5))) ))&quot;;</p>
<p><br>
</p>
<p>I guess the second IF($O11 &gt; 0, $O11, 0.5) is a copy-paste error and should really be IF($O21 &gt; 0, $O21, 0.5) as the proportion of &quot;word&quot; in the second corpus should be used. The source code is version 3.2.11, but the code is consistent with the results
 displayed by 3.1.16. </p>
<p><br>
</p>
<p>Best,</p>
<p>Thoralf</p>
<p><br>
</p>
</body>
</html>