<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=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Lucida Console";
panose-1:2 11 6 9 4 5 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Courier New";
mso-fareast-language:FR-CA;}
span.gd15mcfckub
{mso-style-name:gd15mcfckub;}
span.gd15mcfcktb
{mso-style-name:gd15mcfcktb;}
span.gd15mcfceub
{mso-style-name:gd15mcfceub;}
.MsoChpDefault
{mso-style-type:export-only;
mso-fareast-language:EN-US;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:175772654;
mso-list-type:hybrid;
mso-list-template-ids:-947217970 202113041 202113049 202113051 202113039 202113049 202113051 202113039 202113049 202113051;}
@list l0:level1
{mso-level-text:"%1\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l1
{mso-list-id:592593478;
mso-list-type:hybrid;
mso-list-template-ids:358494096 202113041 202113049 202113051 202113039 202113049 202113051 202113039 202113049 202113051;}
@list l1:level1
{mso-level-text:"%1\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l1:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l1:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l1:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l1:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l1:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l1:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l1:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l1:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l2
{mso-list-id:687099826;
mso-list-type:hybrid;
mso-list-template-ids:-2067387718 202113025 202113027 202113029 202113025 202113027 202113029 202113025 202113027 202113029;}
@list l2:level1
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Symbol;}
@list l2:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Courier New";}
@list l2:level3
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;}
@list l2:level4
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Symbol;}
@list l2:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Courier New";}
@list l2:level6
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;}
@list l2:level7
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Symbol;}
@list l2:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Courier New";}
@list l2:level9
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;}
@list l3
{mso-list-id:713971167;
mso-list-type:hybrid;
mso-list-template-ids:-1729586142 202113041 202113049 202113051 202113039 202113049 202113051 202113039 202113049 202113051;}
@list l3:level1
{mso-level-text:"%1\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l3:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l3:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l3:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l3:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l3:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l3:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l3:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l3:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l4
{mso-list-id:1140805241;
mso-list-type:hybrid;
mso-list-template-ids:-124378974 202113041 202113049 202113051 202113039 202113049 202113051 202113039 202113049 202113051;}
@list l4:level1
{mso-level-text:"%1\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l4:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l4:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l4:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l4:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l4:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l4:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l4:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l4:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></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 lang="FR-CA" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Dear list members,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">In the example dataset attached, the data have this hierarchical structure: 50 Treatments from 20 Experiments from 8 Publications. For each treatment, there is an observed (or reported) value and the corresponding predicted
value by a model under evaluation. I can evaluate the model using the raw predictions and the predictions adjusted with the random effect of Experiment. However, I am not able to calculated the predictions adjusted with the random effect of Experiment nested
into Publication. <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I use the following steps:<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l2 level1 lfo5"><![if !supportLists]><span lang="EN-US" style="font-family:Symbol"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span lang="EN-US">The dataset is imported and renamed “d” and Residuals are calculated<o:p></o:p></span></p>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">#Calculate the residuals<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">d$Residuals <- d$Observed-d$Predicted<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">str(d)<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">'data.frame': 50 obs. of 8 variables:<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in"> $ ID : num 1 2 3 4 5 6 7 8 9 10 ...<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in"> $ Publication: num 1 1 1 1 1 1 1 1 1 2 ...<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in"> $ Experiment : num 1.1 1.1 1.1 1.2 1.2 1.2 1.3 1.3 1.3 2.1 ...<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in"> $ Treatment : num 1 2 3 4 5 6 7 8 9 10 ...<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in"> $ SEM : num 4 4 4 12 12 12 11 11 11 45 ...<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in"> $ Observed : num 141 65 97 178 210 185 147 141 174 217 ...<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in"> $ Predicted : num 136 71 78 158 200 255 141 112 162 259 ...<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in"> $ Residuals : num 5 -6 19 20 10 -70 6 29 12 -42 ...<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black"><o:p> </o:p></span></pre>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l2 level1 lfo5"><![if !supportLists]><span lang="EN-US" style="font-family:Symbol"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span lang="EN-US">Results from the RMSE function (see details of the function at the bottom):<o:p></o:p></span></p>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">#RMSE with raw predictions<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">RMSE(d$Observed, d$Predicted)<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in"> labels output<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">1 N 50.00000<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">2 Observed Mean 172.50000<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">3 Predicted Mean 186.24000<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">4 RMSE 42.14712<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">5 RMSE, % mean 24.43311 (% of observed mean)<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">6 Mean Bias, % MSE 10.62766<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">7 Slope Bias, % MSE 6.49443<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">8 Dispersion, % MSE 82.87792<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">9 Mean Bias -13.74000<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">10 Slope Bias -0.09949<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">11 P-Mean Bias 0.01957<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">12 P-Slope Bias 0.05834<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">13 RSR 0.39921 (RMSE/sd Observed)<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">14 CCC 0.92198</span></span><span style="font-size:8.0pt;font-family:"Lucida Console";color:black"><o:p></o:p></span></pre>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l2 level1 lfo5"><![if !supportLists]><span lang="EN-US" style="font-family:Symbol"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span lang="EN-US">Calculate predictions adjusted with the random effect of Experiment and weighting data with 1/SEM:<o:p></o:p></span></p>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">m1 <- rma.mv(Residuals ~ 1, SEM, random = list(~1|Experiment, ~ 1|Treatment),<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">+ </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4"> data=d, method = "REML", digits=5, sparse = TRUE)</span></span><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black"><o:p></o:p></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">#Source random effects, pull together with Experiments into a dataframe and name columns correctly<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">Study <- ranef.rma.mv(m1)$Experiment<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">Study <- subset (Study, select = c(intrcpt))<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">Experiment <- rownames(Study)<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">r <- cbind(Experiment, Study)<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">names(r) <- c("Experiment", "Study")<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">head(r)<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in"> Experiment Study<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">1.1 1.1 <span style="background:aqua;mso-highlight:aqua">16.01</span><o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">1.2 1.2 -1.04<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> #</span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">Merge random effects back into data<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">d <- merge(d, r, by="Experiment")</span></span><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black"><o:p></o:p></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">#Calculate predictions with study adjustment<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">d$Predicted_Study <- d$Predicted+d$Study</span></span><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black"><o:p></o:p></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">str(d)<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">'data.frame': 50 obs. of 10 variables:<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in"> $ Experiment : num 1.1 1.1 1.1 1.2 1.2 1.2 1.3 1.3 1.3 2.1 ...<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in"> $ ID : num 1 2 3 4 5 6 7 8 9 10 ...<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in"> $ Publication : num 1 1 1 1 1 1 1 1 1 2 ...<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in"> $ Treatment : num 1 2 3 4 5 6 7 8 9 10 ...<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in"> $ SEM : num 4 4 4 12 12 12 11 11 11 10 ...<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in"> $ Observed : num 141 65 97 178 210 185 147 141 174 117 ...<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in"> $ Predicted : num <span style="background:yellow;mso-highlight:yellow">136 71 78 158</span> 200 255 141 112 162 159 ...<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in"> $ Residuals : num 5 -6 19 20 10 -70 6 29 12 -42 ...<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in"> $ Study : num <span style="background:aqua;mso-highlight:aqua">16.01 16.01 16.01</span> -1.04 -1.04 ...<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in"> $ Predicted_Study: num <span style="background:yellow;mso-highlight:yellow">152 87 94 157</span> 199 ...<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">#RMSE with adjusted predictions<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">RMSE(d$Observed, d$Predicted_Study)<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in"> labels output<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">1 N 50.00000<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">2 Observed Mean 172.50000<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">3 Predicted Mean 184.66019<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">4 RMSE 20.45068<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">5 RMSE, % mean 11.85547<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">6 Mean Bias, % MSE 35.35618<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">7 Slope Bias, % MSE 0.48970<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">8 Dispersion, % MSE 64.15412<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">9 Mean Bias -12.16019<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">10 Slope Bias -0.01367<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">11 P-Mean Bias 0.00010<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">12 P-Slope Bias 0.54783<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">13 RSR 0.19371<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">14 CCC 0.98101</span></span><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black"><o:p></o:p></span></pre>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The LRT test indicate that the hierarchical structure of data should be accounted for:</span><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">>
</span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4"># LRT test<o:p></o:p></span></span></p>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">Publication.Experiment.fit <- rma.mv(Residuals ~ 1, SEM, random = list(~1|Publication, ~1|Experiment, ~ 1|Treatment),<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">+ </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4"> data=d, method = "REML", digits=5, sparse = TRUE)<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">Publication.fit <- rma.mv(Residuals ~ 1, SEM, random = list(~1|Publication, ~ 1|Treatment),<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">+ </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4"> data=d, method = "REML", digits=5, sparse = TRUE)<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4"><o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">anova(Publication.Experiment.fit,Publication.fit)<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in"><o:p> </o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in"> df AIC BIC AICc logLik LRT pval QE <o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">Full 4 478.64551 486.21279 479.55460 -235.32275 7451.72582 <o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfceub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black;border:none windowtext 1.0pt;padding:0in">Reduced 3 502.23883 507.91429 502.77216 -248.11941 25.59332 <span style="background:yellow;mso-highlight:yellow"><.00001</span> 7451.72582 </span></span><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black"><o:p></o:p></span></pre>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I would use the following model but I don’t know how to proceed after that:<o:p></o:p></span></p>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">m2 <- rma.mv(Residuals ~ 1, SEM, random = list(~1|Publication, ~1|Experiment, ~ 1|Treatment),<o:p></o:p></span></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">+ </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4"> data=d, method = "REML", digits=5, sparse = TRUE)</span></span><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:black"><o:p></o:p></span></pre>
<pre style="background:white;word-break:break-all"><span class="gd15mcfckub"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">> </span></span><span class="gd15mcfcktb"><span lang="EN-US" style="font-size:8.0pt;font-family:"Lucida Console";color:#C800A4">#Source random effects, pull together with Experiments into a dataframe and name columns correctly<o:p></o:p></span></span></pre>
<p class="MsoNormal"><span lang="EN-US">???<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks in advance,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Roger<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt">#Specify RMSE function to be used ####<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt">RMSE <- function(k,l) {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> if(is.list(l)==TRUE) {iter <- length(l)} else {iter=1}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> for(i in 1:iter) {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> if(is.list(k)==TRUE) { o <- k[[i]]} else {o <- k}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> if(is.list(l)==TRUE) { p <- l[[i]]} else {p <- l}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> d <- data.frame(o, p)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> d$res=d$o-d$p<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> d <- subset(d, is.na(d$res)==FALSE)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> o <- d$o<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> p <- d$p<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> res <- d$res<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> meano <- mean(o, na.rm=TRUE)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> meanp <- mean(p, na.rm=TRUE)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> PMeanBias <- t.test(res)$p.value<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> PMeanBias <- ifelse(PMeanBias < 0.0001, 0.0001, PMeanBias)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> PSlope <- anova(lm(res~p))[1,5]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> PSlope <- ifelse(PSlope < 0.0001, 0.0001, PSlope)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> res2=res^2;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> rm=sqrt(mean(res2, na.rm=TRUE));<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> uss=sum(res2, na.rm=TRUE);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> lo <- ifelse(is.na(o)==FALSE, 1, 0)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> n=sum(lo);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> meano=mean(o, na.rm=TRUE);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> mb=sum(res, na.rm=TRUE)/n;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> sse <- anova(lm(res~p))[2,2];<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> msb <- mb^2;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> mspe <- rm^2;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> msre <- sse/n;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> msslope <- mspe-msre-msb;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> mean <- msb/mspe*100;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> slope <- msslope/mspe*100;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> residual <- msre/mspe*100;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> check <- mean+slope+residual<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> rsr <- rm/sd(o, na.rm=TRUE)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> ccc <- epi.ccc(o,p)$rho.c[1]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> rmp = rm/meano*100<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> mb <- mean(res, na.rm=TRUE)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> sb <- coef(lm(res~p))[2]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> output <- format(c(<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> n, meano, meanp,
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> rm, rmp, <o:p>
</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> mean, slope, residual,
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> mb, sb, PMeanBias, PSlope,
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> rsr, ccc[,1]), digits=4, scientific=FALSE)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> labels <- c(<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> "N", "Observed Mean", "Predicted Mean",
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> "RMSE", "RMSE, % mean",
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> "Mean Bias, % MSE", "Slope Bias, % MSE", "Dispersion, % MSE",
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> "Mean Bias", "Slope Bias", "P-Mean Bias", "P-Slope Bias",
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> "RSR", "CCC")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> if(i==1) {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> out <- data.frame(labels,output)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> else {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> out <- cbind(out, output)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt"> return(out)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt">}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</body>
</html>