<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Verdana","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D">Yes, good catch. I don’t think it’s necessarily even a copy-paste error – it’s more likely my brain just hiccupped in the process of typing out all the 1s and
 2s….<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D">Anyway, fixed in 3.2.21<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D">best<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D">Andrew.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> cwb-bounces@sslmit.unibo.it [mailto:cwb-bounces@sslmit.unibo.it]
<b>On Behalf Of </b>Mildenberger Thoralf (mild)<br>
<b>Sent:</b> 03 July 2016 14:23<br>
<b>To:</b> cwb@sslmit.unibo.it<br>
<b>Subject:</b> [CWB] Bug in Confidence Interval filter for keyowords using Log Ratio<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">Dear developers,<o:p></o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">I tired to reproduce the confidence intervals for the Log Ratio for the keywords function in
<o:p></o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">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;:<o:p></o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">$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;;<o:p></o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">shouldn't that be:
<o:p></o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">$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;;<o:p></o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">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.
<o:p></o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">Best,<o:p></o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">Thoralf<o:p></o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
</div>
</body>
</html>