<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />


<meta name="author" content="Yuxin Zou" />

<meta name="date" content="2018-07-09" />

<title>Estimate Null Correlation Problem</title>

<script src="site_libs/jquery-1.11.3/jquery.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="site_libs/bootstrap-3.3.5/css/cosmo.min.css" rel="stylesheet" />
<script src="site_libs/bootstrap-3.3.5/js/bootstrap.min.js"></script>
<script src="site_libs/bootstrap-3.3.5/shim/html5shiv.min.js"></script>
<script src="site_libs/bootstrap-3.3.5/shim/respond.min.js"></script>
<script src="site_libs/jqueryui-1.11.4/jquery-ui.min.js"></script>
<link href="site_libs/tocify-1.9.1/jquery.tocify.css" rel="stylesheet" />
<script src="site_libs/tocify-1.9.1/jquery.tocify.js"></script>
<script src="site_libs/navigation-1.1/tabsets.js"></script>
<script src="site_libs/navigation-1.1/codefolding.js"></script>
<link href="site_libs/highlightjs-9.12.0/textmate.css" rel="stylesheet" />
<script src="site_libs/highlightjs-9.12.0/highlight.js"></script>
<script src="site_libs/kePrint-0.0.1/kePrint.js"></script>
<link href="site_libs/font-awesome-5.0.13/css/fa-svg-with-js.css" rel="stylesheet" />
<script src="site_libs/font-awesome-5.0.13/js/fontawesome-all.min.js"></script>
<script src="site_libs/font-awesome-5.0.13/js/fa-v4-shims.min.js"></script>

<style type="text/css">code{white-space: pre;}</style>
<style type="text/css">
  pre:not([class]) {
    background-color: white;
  }
</style>
<script type="text/javascript">
if (window.hljs) {
  hljs.configure({languages: []});
  hljs.initHighlightingOnLoad();
  if (document.readyState && document.readyState === "complete") {
    window.setTimeout(function() { hljs.initHighlighting(); }, 0);
  }
}
</script>



<style type="text/css">
h1 {
  font-size: 34px;
}
h1.title {
  font-size: 38px;
}
h2 {
  font-size: 30px;
}
h3 {
  font-size: 24px;
}
h4 {
  font-size: 18px;
}
h5 {
  font-size: 16px;
}
h6 {
  font-size: 12px;
}
.table th:not([align]) {
  text-align: left;
}
</style>


</head>

<body>

<style type = "text/css">
.main-container {
  max-width: 940px;
  margin-left: auto;
  margin-right: auto;
}
code {
  color: inherit;
  background-color: rgba(0, 0, 0, 0.04);
}
img {
  max-width:100%;
  height: auto;
}
.tabbed-pane {
  padding-top: 12px;
}
.html-widget {
  margin-bottom: 20px;
}
button.code-folding-btn:focus {
  outline: none;
}
</style>


<style type="text/css">
/* padding for bootstrap navbar */
body {
  padding-top: 51px;
  padding-bottom: 40px;
}
/* offset scroll position for anchor links (for fixed navbar)  */
.section h1 {
  padding-top: 56px;
  margin-top: -56px;
}

.section h2 {
  padding-top: 56px;
  margin-top: -56px;
}
.section h3 {
  padding-top: 56px;
  margin-top: -56px;
}
.section h4 {
  padding-top: 56px;
  margin-top: -56px;
}
.section h5 {
  padding-top: 56px;
  margin-top: -56px;
}
.section h6 {
  padding-top: 56px;
  margin-top: -56px;
}
</style>

<script>
// manage active state of menu based on current page
$(document).ready(function () {
  // active menu anchor
  href = window.location.pathname
  href = href.substr(href.lastIndexOf('/') + 1)
  if (href === "")
    href = "index.html";
  var menuAnchor = $('a[href="' + href + '"]');

  // mark it active
  menuAnchor.parent().addClass('active');

  // if it's got a parent navbar menu mark it active as well
  menuAnchor.closest('li.dropdown').addClass('active');
});
</script>


<div class="container-fluid main-container">

<!-- tabsets -->
<script>
$(document).ready(function () {
  window.buildTabsets("TOC");
});
</script>

<!-- code folding -->
<style type="text/css">
.code-folding-btn { margin-bottom: 4px; }
</style>
<script>
$(document).ready(function () {
  window.initializeCodeFolding("hide" === "show");
});
</script>




<script>
$(document).ready(function ()  {

    // move toc-ignore selectors from section div to header
    $('div.section.toc-ignore')
        .removeClass('toc-ignore')
        .children('h1,h2,h3,h4,h5').addClass('toc-ignore');

    // establish options
    var options = {
      selectors: "h1,h2,h3",
      theme: "bootstrap3",
      context: '.toc-content',
      hashGenerator: function (text) {
        return text.replace(/[.\\/?&!#<>]/g, '').replace(/\s/g, '_').toLowerCase();
      },
      ignoreSelector: ".toc-ignore",
      scrollTo: 0
    };
    options.showAndHide = true;
    options.smoothScroll = true;

    // tocify
    var toc = $("#TOC").tocify(options).data("toc-tocify");
});
</script>

<style type="text/css">

#TOC {
  margin: 25px 0px 20px 0px;
}
@media (max-width: 768px) {
#TOC {
  position: relative;
  width: 100%;
}
}


.toc-content {
  padding-left: 30px;
  padding-right: 40px;
}

div.main-container {
  max-width: 1200px;
}

div.tocify {
  width: 20%;
  max-width: 260px;
  max-height: 85%;
}

@media (min-width: 768px) and (max-width: 991px) {
  div.tocify {
    width: 25%;
  }
}

@media (max-width: 767px) {
  div.tocify {
    width: 100%;
    max-width: none;
  }
}

.tocify ul, .tocify li {
  line-height: 20px;
}

.tocify-subheader .tocify-item {
  font-size: 0.90em;
  padding-left: 25px;
  text-indent: 0;
}

.tocify .list-group-item {
  border-radius: 0px;
}


</style>

<!-- setup 3col/9col grid for toc_float and main content  -->
<div class="row-fluid">
<div class="col-xs-12 col-sm-4 col-md-3">
<div id="TOC" class="tocify">
</div>
</div>

<div class="toc-content col-xs-12 col-sm-8 col-md-9">




<div class="navbar navbar-default  navbar-fixed-top" role="navigation">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="index.html">mash_application</a>
    </div>
    <div id="navbar" class="navbar-collapse collapse">
      <ul class="nav navbar-nav">
        <li>
  <a href="index.html">Home</a>
</li>
<li>
  <a href="about.html">About</a>
</li>
<li>
  <a href="license.html">License</a>
</li>
      </ul>
      <ul class="nav navbar-nav navbar-right">
        <li>
  <a href="https://github.com/zouyuxin/mash_application">
    <span class="fa fa-github"></span>
     
  </a>
</li>
      </ul>
    </div><!--/.nav-collapse -->
  </div><!--/.container -->
</div><!--/.navbar -->

<!-- Add a small amount of space between sections. -->
<style type="text/css">
div.section {
  padding-top: 12px;
}
</style>

<div class="fluid-row" id="header">

<div class="btn-group pull-right">
<button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span>Code</span> <span class="caret"></span></button>
<ul class="dropdown-menu" style="min-width: 50px;">
<li><a id="rmd-show-all-code" href="#">Show All Code</a></li>
<li><a id="rmd-hide-all-code" href="#">Hide All Code</a></li>
</ul>
</div>



<h1 class="title toc-ignore">Estimate Null Correlation Problem</h1>
<h4 class="author"><em>Yuxin Zou</em></h4>
<h4 class="date"><em>2018-07-09</em></h4>

</div>


<p><strong>Last updated:</strong> 2018-10-08</p>
<strong>workflowr checks:</strong> <small>(Click a bullet for more information)</small>
<ul>
<li>
<p><details> <summary> <strong style="color:blue;">✔</strong> <strong>R Markdown file:</strong> up-to-date </summary></p>
<p>Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.</p>
</details>
</li>
<li>
<p><details> <summary> <strong style="color:blue;">✔</strong> <strong>Environment:</strong> empty </summary></p>
<p>Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.</p>
</details>
</li>
<li>
<p><details> <summary> <strong style="color:blue;">✔</strong> <strong>Seed:</strong> <code>set.seed(1)</code> </summary></p>
<p>The command <code>set.seed(1)</code> was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.</p>
</details>
</li>
<li>
<p><details> <summary> <strong style="color:blue;">✔</strong> <strong>Session information:</strong> recorded </summary></p>
<p>Great job! Recording the operating system, R version, and package versions is critical for reproducibility.</p>
</details>
</li>
<li>
<p><details> <summary> <strong style="color:blue;">✔</strong> <strong>Repository version:</strong> <a href="https://github.com/zouyuxin/mash_application/tree/c12be7697b6c89fdc963b01a0585fc722dfc53a1" target="_blank">c12be76</a> </summary></p>
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility. The version displayed above was the version of the Git repository at the time these results were generated. <br><br> Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use <code>wflow_publish</code> or <code>wflow_git_commit</code>). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
<pre><code>
Ignored files:
    Ignored:    .DS_Store
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    analysis/.DS_Store
    Ignored:    analysis/.Rhistory
    Ignored:    analysis/include/.DS_Store
    Ignored:    code/.DS_Store
    Ignored:    data/.DS_Store
    Ignored:    docs/.DS_Store
    Ignored:    output/.DS_Store

Untracked files:
    Untracked:  analysis/Classify.Rmd
    Untracked:  analysis/EstimateCorEM2.Rmd
    Untracked:  analysis/EstimateCorEM3.Rmd
    Untracked:  analysis/EstimateCorMaxEMGD.Rmd
    Untracked:  analysis/EstimateCorMaxGD.Rmd
    Untracked:  analysis/EstimateCorMaxMV.Rmd
    Untracked:  analysis/EstimateCorOptimEM.Rmd
    Untracked:  analysis/EstimateCorPrior.Rmd
    Untracked:  analysis/EstimateCorSol.Rmd
    Untracked:  analysis/HierarchicalFlashSim.Rmd
    Untracked:  analysis/MashLowSignalGTEx4.Rmd
    Untracked:  analysis/Mash_GTEx.Rmd
    Untracked:  analysis/MeanAsh.Rmd
    Untracked:  analysis/OutlierDetection.Rmd
    Untracked:  analysis/OutlierDetection2.Rmd
    Untracked:  analysis/OutlierDetection3.Rmd
    Untracked:  analysis/OutlierDetection4.Rmd
    Untracked:  analysis/mash_missing_row.Rmd
    Untracked:  code/GTExNullModel.R
    Untracked:  code/MASH.result.1.rds
    Untracked:  code/MashClassify.R
    Untracked:  code/MashCorResult.R
    Untracked:  code/MashNULLCorResult.R
    Untracked:  code/MashSource.R
    Untracked:  code/Weight_plot.R
    Untracked:  code/addemV.R
    Untracked:  code/estimate_cor.R
    Untracked:  code/generateDataV.R
    Untracked:  code/johnprocess.R
    Untracked:  code/sim_mean_sig.R
    Untracked:  code/summary.R
    Untracked:  data/Blischak_et_al_2015/
    Untracked:  data/scale_data.rds
    Untracked:  docs/figure/Classify.Rmd/
    Untracked:  docs/figure/OutlierDetection.Rmd/
    Untracked:  docs/figure/OutlierDetection2.Rmd/
    Untracked:  docs/figure/OutlierDetection3.Rmd/
    Untracked:  docs/figure/Test.Rmd/
    Untracked:  docs/figure/mash_missing_whole_row_5.Rmd/
    Untracked:  docs/include/
    Untracked:  output/AddEMV/
    Untracked:  output/CovED_UKBio_strong.rds
    Untracked:  output/CovED_UKBio_strong_Z.rds
    Untracked:  output/Flash_UKBio_strong.rds
    Untracked:  output/GTExNULLres/
    Untracked:  output/GTEx_2.5_nullData.rds
    Untracked:  output/GTEx_2.5_nullModel.rds
    Untracked:  output/GTEx_2.5_nullPermData.rds
    Untracked:  output/GTEx_2.5_nullPermModel.rds
    Untracked:  output/GTEx_3.5_nullData.rds
    Untracked:  output/GTEx_3.5_nullModel.rds
    Untracked:  output/GTEx_3.5_nullPermData.rds
    Untracked:  output/GTEx_3.5_nullPermModel.rds
    Untracked:  output/GTEx_3_nullData.rds
    Untracked:  output/GTEx_3_nullModel.rds
    Untracked:  output/GTEx_3_nullPermData.rds
    Untracked:  output/GTEx_3_nullPermModel.rds
    Untracked:  output/GTEx_4.5_nullData.rds
    Untracked:  output/GTEx_4.5_nullModel.rds
    Untracked:  output/GTEx_4.5_nullPermData.rds
    Untracked:  output/GTEx_4.5_nullPermModel.rds
    Untracked:  output/GTEx_4_nullData.rds
    Untracked:  output/GTEx_4_nullModel.rds
    Untracked:  output/GTEx_4_nullPermData.rds
    Untracked:  output/GTEx_4_nullPermModel.rds
    Untracked:  output/MASH.10.em2.result.rds
    Untracked:  output/MASH.10.mle.result.rds
    Untracked:  output/MASHNULL.V.result.1.rds
    Untracked:  output/MASHNULL.V.result.10.rds
    Untracked:  output/MASHNULL.V.result.11.rds
    Untracked:  output/MASHNULL.V.result.12.rds
    Untracked:  output/MASHNULL.V.result.13.rds
    Untracked:  output/MASHNULL.V.result.14.rds
    Untracked:  output/MASHNULL.V.result.15.rds
    Untracked:  output/MASHNULL.V.result.16.rds
    Untracked:  output/MASHNULL.V.result.17.rds
    Untracked:  output/MASHNULL.V.result.18.rds
    Untracked:  output/MASHNULL.V.result.19.rds
    Untracked:  output/MASHNULL.V.result.2.rds
    Untracked:  output/MASHNULL.V.result.20.rds
    Untracked:  output/MASHNULL.V.result.3.rds
    Untracked:  output/MASHNULL.V.result.4.rds
    Untracked:  output/MASHNULL.V.result.5.rds
    Untracked:  output/MASHNULL.V.result.6.rds
    Untracked:  output/MASHNULL.V.result.7.rds
    Untracked:  output/MASHNULL.V.result.8.rds
    Untracked:  output/MASHNULL.V.result.9.rds
    Untracked:  output/MashCorSim--midway/
    Untracked:  output/Mash_EE_Cov_0_plusR1.rds
    Untracked:  output/UKBio_mash_model.rds

Unstaged changes:
    Modified:   analysis/EstimateCorEM.Rmd
    Modified:   analysis/EstimateCorIndex.Rmd
    Deleted:    analysis/EstimateCorMax.Rmd
    Modified:   analysis/EstimateCorMaxEM2.Rmd
    Modified:   analysis/EstimateCorMaxMash.Rmd
    Modified:   analysis/EstimateCorOptim.Rmd
    Deleted:    analysis/MashLowSignalGTEx3.5P.Rmd
    Modified:   analysis/Mash_UKBio.Rmd
    Modified:   analysis/mash_missing_samplesize.Rmd
    Modified:   output/Flash_T2_0.rds
    Modified:   output/Flash_T2_0_mclust.rds
    Modified:   output/Mash_model_0_plusR1.rds
    Modified:   output/PresiAddVarCol.rds

</code></pre>
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes. </details>
</li>
</ul>
<details> <summary> <small><strong>Expand here to see past versions:</strong></small> </summary>
<ul>
<table style="border-collapse:separate; border-spacing:5px;">
<thead>
<tr>
<th style="text-align:left;">
File
</th>
<th style="text-align:left;">
Version
</th>
<th style="text-align:left;">
Author
</th>
<th style="text-align:left;">
Date
</th>
<th style="text-align:left;">
Message
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;">
Rmd
</td>
<td style="text-align:left;">
<a href="https://github.com/zouyuxin/mash_application/blob/c12be7697b6c89fdc963b01a0585fc722dfc53a1/analysis/EstimateCor.Rmd" target="_blank">c12be76</a>
</td>
<td style="text-align:left;">
zouyuxin
</td>
<td style="text-align:left;">
2018-10-08
</td>
<td style="text-align:left;">
wflow_publish(“analysis/EstimateCor.Rmd”)
</td>
</tr>
<tr>
<td style="text-align:left;">
html
</td>
<td style="text-align:left;">
<a href="https://cdn.rawgit.com/zouyuxin/mash_application/a9d24277fd5bbaf46ae25a12927b47d7cdfef786/docs/EstimateCor.html" target="_blank">a9d2427</a>
</td>
<td style="text-align:left;">
zouyuxin
</td>
<td style="text-align:left;">
2018-09-20
</td>
<td style="text-align:left;">
Build site.
</td>
</tr>
<tr>
<td style="text-align:left;">
html
</td>
<td style="text-align:left;">
<a href="https://cdn.rawgit.com/zouyuxin/mash_application/518541d154b3fa7828f7c178a93faef43821ce0e/docs/EstimateCor.html" target="_blank">518541d</a>
</td>
<td style="text-align:left;">
zouyuxin
</td>
<td style="text-align:left;">
2018-08-20
</td>
<td style="text-align:left;">
Build site.
</td>
</tr>
<tr>
<td style="text-align:left;">
Rmd
</td>
<td style="text-align:left;">
<a href="https://github.com/zouyuxin/mash_application/blob/a80bf6fb0bbdfc6098d7ae53d69d7acff067d021/analysis/EstimateCor.Rmd" target="_blank">a80bf6f</a>
</td>
<td style="text-align:left;">
zouyuxin
</td>
<td style="text-align:left;">
2018-08-20
</td>
<td style="text-align:left;">
wflow_publish(“analysis/EstimateCor.Rmd”)
</td>
</tr>
<tr>
<td style="text-align:left;">
html
</td>
<td style="text-align:left;">
<a href="https://cdn.rawgit.com/zouyuxin/mash_application/62810624e8b7cc75109ca79be9ff51319899148a/docs/EstimateCor.html" target="_blank">6281062</a>
</td>
<td style="text-align:left;">
zouyuxin
</td>
<td style="text-align:left;">
2018-08-15
</td>
<td style="text-align:left;">
Build site.
</td>
</tr>
<tr>
<td style="text-align:left;">
Rmd
</td>
<td style="text-align:left;">
<a href="https://github.com/zouyuxin/mash_application/blob/3e3e128938bbfd03d7061d5b1242376a4a4a5058/analysis/EstimateCor.Rmd" target="_blank">3e3e128</a>
</td>
<td style="text-align:left;">
zouyuxin
</td>
<td style="text-align:left;">
2018-08-15
</td>
<td style="text-align:left;">
wflow_publish(c(“analysis/EstimateCor.Rmd”, “analysis/EstimateCorMax.Rmd”,
</td>
</tr>
<tr>
<td style="text-align:left;">
html
</td>
<td style="text-align:left;">
<a href="https://cdn.rawgit.com/zouyuxin/mash_application/05731ebdc30e3fb82be1ab8ea314dde836e30011/docs/EstimateCor.html" target="_blank">05731eb</a>
</td>
<td style="text-align:left;">
zouyuxin
</td>
<td style="text-align:left;">
2018-08-15
</td>
<td style="text-align:left;">
Build site.
</td>
</tr>
<tr>
<td style="text-align:left;">
Rmd
</td>
<td style="text-align:left;">
<a href="https://github.com/zouyuxin/mash_application/blob/ccc1607b8588ebfe6a47ee27a54e3d493171514f/analysis/EstimateCor.Rmd" target="_blank">ccc1607</a>
</td>
<td style="text-align:left;">
zouyuxin
</td>
<td style="text-align:left;">
2018-08-15
</td>
<td style="text-align:left;">
wflow_publish(c(“analysis/EstimateCorIndex.Rmd”, “analysis/EstimateCor.Rmd”))
</td>
</tr>
<tr>
<td style="text-align:left;">
html
</td>
<td style="text-align:left;">
<a href="https://cdn.rawgit.com/zouyuxin/mash_application/568fbe632239ed4a2ec52f4dd5f001b71d615530/docs/EstimateCor.html" target="_blank">568fbe6</a>
</td>
<td style="text-align:left;">
zouyuxin
</td>
<td style="text-align:left;">
2018-08-13
</td>
<td style="text-align:left;">
Build site.
</td>
</tr>
<tr>
<td style="text-align:left;">
Rmd
</td>
<td style="text-align:left;">
<a href="https://github.com/zouyuxin/mash_application/blob/3ae3f08be525fa2f3c7a50d4d25cefde7cd7ca37/analysis/EstimateCor.Rmd" target="_blank">3ae3f08</a>
</td>
<td style="text-align:left;">
zouyuxin
</td>
<td style="text-align:left;">
2018-08-13
</td>
<td style="text-align:left;">
wflow_publish(c(“analysis/EstimateCor.Rmd”,
</td>
</tr>
<tr>
<td style="text-align:left;">
html
</td>
<td style="text-align:left;">
<a href="https://cdn.rawgit.com/zouyuxin/mash_application/10d4174c6f044161bf17e623f1b474618cae2114/docs/EstimateCor.html" target="_blank">10d4174</a>
</td>
<td style="text-align:left;">
zouyuxin
</td>
<td style="text-align:left;">
2018-08-13
</td>
<td style="text-align:left;">
Build site.
</td>
</tr>
<tr>
<td style="text-align:left;">
Rmd
</td>
<td style="text-align:left;">
<a href="https://github.com/zouyuxin/mash_application/blob/b8c1cd8ae3639a7159924ea03fd209649e7bb8c7/analysis/EstimateCor.Rmd" target="_blank">b8c1cd8</a>
</td>
<td style="text-align:left;">
zouyuxin
</td>
<td style="text-align:left;">
2018-08-13
</td>
<td style="text-align:left;">
wflow_publish(“analysis/EstimateCor.Rmd”)
</td>
</tr>
<tr>
<td style="text-align:left;">
html
</td>
<td style="text-align:left;">
<a href="https://cdn.rawgit.com/zouyuxin/mash_application/3bfa4f502083ab1d6ba500fc0572aaf7200d6c8d/docs/EstimateCor.html" target="_blank">3bfa4f5</a>
</td>
<td style="text-align:left;">
zouyuxin
</td>
<td style="text-align:left;">
2018-08-13
</td>
<td style="text-align:left;">
Build site.
</td>
</tr>
<tr>
<td style="text-align:left;">
Rmd
</td>
<td style="text-align:left;">
<a href="https://github.com/zouyuxin/mash_application/blob/49d53fb5534caea4e69f8065ad3429c2ec1552e1/analysis/EstimateCor.Rmd" target="_blank">49d53fb</a>
</td>
<td style="text-align:left;">
zouyuxin
</td>
<td style="text-align:left;">
2018-08-13
</td>
<td style="text-align:left;">
wflow_publish(“analysis/EstimateCor.Rmd”)
</td>
</tr>
<tr>
<td style="text-align:left;">
html
</td>
<td style="text-align:left;">
<a href="https://cdn.rawgit.com/zouyuxin/mash_application/6e4f0a1b7a5da19a1dd1ad4747bf8dd0f97de8a5/docs/EstimateCor.html" target="_blank">6e4f0a1</a>
</td>
<td style="text-align:left;">
zouyuxin
</td>
<td style="text-align:left;">
2018-08-03
</td>
<td style="text-align:left;">
Build site.
</td>
</tr>
<tr>
<td style="text-align:left;">
Rmd
</td>
<td style="text-align:left;">
<a href="https://github.com/zouyuxin/mash_application/blob/c330f07db7d367bdb817136d0bd817a3a505a17e/analysis/EstimateCor.Rmd" target="_blank">c330f07</a>
</td>
<td style="text-align:left;">
zouyuxin
</td>
<td style="text-align:left;">
2018-08-03
</td>
<td style="text-align:left;">
wflow_publish(c(“analysis/EstimateCor.Rmd”))
</td>
</tr>
<tr>
<td style="text-align:left;">
html
</td>
<td style="text-align:left;">
<a href="https://cdn.rawgit.com/zouyuxin/mash_application/298546692568623165a25b72aac7faf332377c70/docs/EstimateCor.html" target="_blank">2985466</a>
</td>
<td style="text-align:left;">
zouyuxin
</td>
<td style="text-align:left;">
2018-07-26
</td>
<td style="text-align:left;">
Build site.
</td>
</tr>
<tr>
<td style="text-align:left;">
Rmd
</td>
<td style="text-align:left;">
<a href="https://github.com/zouyuxin/mash_application/blob/e2c5ebd1931ea676f6db7f4526914788f44a4844/analysis/EstimateCor.Rmd" target="_blank">e2c5ebd</a>
</td>
<td style="text-align:left;">
zouyuxin
</td>
<td style="text-align:left;">
2018-07-26
</td>
<td style="text-align:left;">
wflow_publish(“analysis/EstimateCor.Rmd”)
</td>
</tr>
</tbody>
</table>
</ul>
<p></details></p>
<hr />
<pre class="r"><code>library(mashr)</code></pre>
<pre><code>Loading required package: ashr</code></pre>
<pre class="r"><code>library(knitr)
library(kableExtra)
source(&#39;../code/generateDataV.R&#39;)
source(&#39;../code/summary.R&#39;)</code></pre>
<p>We illustrate the problem about estimating the correlation matrix in <code>mashr</code>.</p>
<p>In my simple simulation, the current approach underestimates the null correlation. We want to find better positive definite estimator. We could try to estimate the pairwise correlation, ie. mle of <span class="math inline">\(\sum_{l,k} \pi_{lk} N_{2}(0, V + w_{l}U_{k})\)</span> for any pair of conditions.</p>
<div id="problem" class="section level2">
<h2>Problem</h2>
<p>Simple simulation in <span class="math inline">\(R^2\)</span> to illustrate the problem: <span class="math display">\[
\hat{\beta}|\beta \sim N_{2}(\hat{\beta}; \beta, \left(\begin{matrix} 1 &amp; 0.5 \\
                                          0.5 &amp; 1 \end{matrix}\right))
\]</span></p>
<p><span class="math display">\[
\beta \sim \frac{1}{4}\delta_{0} + \frac{1}{4}N_{2}(0, \left(\begin{matrix} 1 &amp; 0 \\
                                          0 &amp; 0 \end{matrix}\right)) + \frac{1}{4}N_{2}(0, \left(\begin{matrix} 0 &amp; 0 \\
                                          0 &amp; 1 \end{matrix}\right)) + \frac{1}{4}N_{2}(0, \left(\begin{matrix} 1 &amp; 1 \\
                                          1 &amp; 1 \end{matrix}\right))
\]</span></p>
<p><span class="math inline">\(\Rightarrow\)</span> <span class="math display">\[
\hat{\beta} \sim \frac{1}{4}N_{2}(0, \left( \begin{matrix} 1 &amp; 0.5 \\
0.5 &amp; 1 \end{matrix} \right)) + \frac{1}{4}N_{2}(0, \left( \begin{matrix} 2 &amp; 0.5 \\
0.5 &amp; 1 \end{matrix} \right)) + \frac{1}{4}N_{2}(0, \left( \begin{matrix} 1 &amp; 0.5 \\
0.5 &amp; 2 \end{matrix} \right)) + \frac{1}{4}N_{2}(0, \left( \begin{matrix} 2 &amp; 1.5 \\
1.5 &amp; 2 \end{matrix} \right))
\]</span></p>
<p>n = 4000</p>
<pre class="r"><code>set.seed(1)
n = 4000; p = 2
Sigma = matrix(c(1,0.5,0.5,1),p,p)
U0 = matrix(0,2,2)
U1 = U0; U1[1,1] = 1
U2 = U0; U2[2,2] = 1
U3 = matrix(1,2,2)
Utrue = list(U0=U0, U1=U1, U2=U2, U3=U3)
data = generate_data(n, p, Sigma, Utrue)</code></pre>
<p>Let’s check the result of <code>mash</code> under different correlation matrix:</p>
<ol style="list-style-type: decimal">
<li>Identity <span class="math display">\[
V.I = I_{2}
\]</span></li>
</ol>
<pre class="r"><code>m.data = mash_set_data(data$Bhat, data$Shat)
U.c = cov_canonical(m.data)
m.I = mash(m.data, U.c, verbose= FALSE)</code></pre>
<ol start="2" style="list-style-type: decimal">
<li>The current approach: truncated empirical correlation, <span class="math inline">\(V.trun\)</span></li>
</ol>
<p>The correlation of samples with maximum |z| scores less than 2.</p>
<pre class="r"><code>Vhat = estimate_null_correlation(m.data, apply_lower_bound = FALSE)
Vhat</code></pre>
<pre><code>          [,1]      [,2]
[1,] 1.0000000 0.3439205
[2,] 0.3439205 1.0000000</code></pre>
<p>It underestimates the correlation.</p>
<pre class="r"><code># Use underestimate cor
m.data.V = mash_set_data(data$Bhat, data$Shat, V=Vhat)
m.V = mash(m.data.V, U.c, verbose = FALSE)</code></pre>
<ol start="3" style="list-style-type: decimal">
<li>Overestimate correlation <span class="math display">\[
V.o = \left( \begin{matrix} 1 &amp; 0.65 \\ 0.65 &amp; 1\end{matrix}  \right)
\]</span></li>
</ol>
<pre class="r"><code># If we overestimate cor
V.o = matrix(c(1,0.65,0.65,1),2,2)
m.data.Vo = mash_set_data(data$Bhat, data$Shat, V=V.o)
m.Vo = mash(m.data.Vo, U.c, verbose=FALSE)</code></pre>
<ol start="4" style="list-style-type: decimal">
<li>mash.1by1</li>
</ol>
<p>We run ash for each condition, and estimate correlation matrix based on the non-significant genes. The estimated cor is closer to the truth.</p>
<pre class="r"><code>m.1by1 = mash_1by1(m.data)
strong = get_significant_results(m.1by1)
V.mash = cor(data$Bhat[-strong,])
V.mash</code></pre>
<pre><code>          [,1]      [,2]
[1,] 1.0000000 0.4597745
[2,] 0.4597745 1.0000000</code></pre>
<pre class="r"><code>m.data.1by1 = mash_set_data(data$Bhat, data$Shat, V=V.mash)
m.V1by1 = mash(m.data.1by1, U.c, verbose = FALSE)</code></pre>
<ol start="5" style="list-style-type: decimal">
<li>True correlation</li>
</ol>
<pre class="r"><code># With correct cor
m.data.correct = mash_set_data(data$Bhat, data$Shat, V=Sigma)
m.correct = mash(m.data.correct, U.c, verbose = FALSE)</code></pre>
<p>The results are summarized in table:</p>
<pre class="r"><code>null.ind = which(apply(data$B,1,sum) == 0)
V.trun = c(get_loglik(m.V), length(get_significant_results(m.V)), sum(get_significant_results(m.V) %in% null.ind))
V.I = c(get_loglik(m.I), length(get_significant_results(m.I)), sum(get_significant_results(m.I) %in% null.ind))
V.over = c(get_loglik(m.Vo), length(get_significant_results(m.Vo)), sum(get_significant_results(m.Vo) %in% null.ind))
V.1by1 = c(get_loglik(m.V1by1), length(get_significant_results(m.V1by1)), sum(get_significant_results(m.V1by1) %in% null.ind))
V.correct = c(get_loglik(m.correct), length(get_significant_results(m.correct)), sum(get_significant_results(m.correct) %in% null.ind))
temp = cbind(V.I, V.trun, V.1by1, V.correct, V.over)
colnames(temp) = c(&#39;Identity&#39;,&#39;truncate&#39;, &#39;m.1by1&#39;, &#39;true&#39;, &#39;overestimate&#39;)
row.names(temp) = c(&#39;log likelihood&#39;, &#39;# significance&#39;, &#39;# False positive&#39;)
temp %&gt;% kable() %&gt;% kable_styling()</code></pre>
<table class="table" style="margin-left: auto; margin-right: auto;">
<thead>
<tr>
<th style="text-align:left;">
</th>
<th style="text-align:right;">
Identity
</th>
<th style="text-align:right;">
truncate
</th>
<th style="text-align:right;">
m.1by1
</th>
<th style="text-align:right;">
true
</th>
<th style="text-align:right;">
overestimate
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;">
log likelihood
</td>
<td style="text-align:right;">
-12390.14
</td>
<td style="text-align:right;">
-12307.65
</td>
<td style="text-align:right;">
-12304.13
</td>
<td style="text-align:right;">
-12302.62
</td>
<td style="text-align:right;">
-12301.81
</td>
</tr>
<tr>
<td style="text-align:left;">
# significance
</td>
<td style="text-align:right;">
166.00
</td>
<td style="text-align:right;">
30.00
</td>
<td style="text-align:right;">
25.00
</td>
<td style="text-align:right;">
25.00
</td>
<td style="text-align:right;">
70.00
</td>
</tr>
<tr>
<td style="text-align:left;">
# False positive
</td>
<td style="text-align:right;">
14.00
</td>
<td style="text-align:right;">
1.00
</td>
<td style="text-align:right;">
0.00
</td>
<td style="text-align:right;">
0.00
</td>
<td style="text-align:right;">
4.00
</td>
</tr>
</tbody>
</table>
<!--
The estimated `pi` is

```r
par(mfrow=c(2,3))
barplot(get_estimated_pi(m.I), las=2, cex.names = 0.7, main='Identity', ylim=c(0,0.8))
barplot(get_estimated_pi(m.V), las=2, cex.names = 0.7, main='Truncate', ylim=c(0,0.8))
barplot(get_estimated_pi(m.V1by1), las=2, cex.names = 0.7, main='m.1by1', ylim=c(0,0.8))
barplot(get_estimated_pi(m.correct), las=2, cex.names = 0.7, main='True', ylim=c(0,0.8))
barplot(get_estimated_pi(m.Vo), las=2, cex.names = 0.7, main='OverEst', ylim=c(0,0.8))
```

<img src="figure/EstimateCor.Rmd/unnamed-chunk-10-1.png" width="672" style="display: block; margin: auto;" />

  <details>
  <summary><em>Expand here to see past versions of unnamed-chunk-10-1.png:</em></summary>
  <table style = "border-collapse:separate; border-spacing:5px;">
  <thead>
  <tr>
  <th style="text-align:left;"> Version </th>
  <th style="text-align:left;"> Author </th>
  <th style="text-align:left;"> Date </th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align:left;"> <a href="https://github.com/zouyuxin/mash_application/blob/10d4174c6f044161bf17e623f1b474618cae2114/docs/figure/EstimateCor.Rmd/unnamed-chunk-10-1.png" target="_blank">10d4174</a> </td>
  <td style="text-align:left;"> zouyuxin </td>
  <td style="text-align:left;"> 2018-08-13 </td>
  </tr>
  <tr>
  <td style="text-align:left;"> <a href="https://github.com/zouyuxin/mash_application/blob/3bfa4f502083ab1d6ba500fc0572aaf7200d6c8d/docs/figure/EstimateCor.Rmd/unnamed-chunk-10-1.png" target="_blank">3bfa4f5</a> </td>
  <td style="text-align:left;"> zouyuxin </td>
  <td style="text-align:left;"> 2018-08-13 </td>
  </tr>
  <tr>
  <td style="text-align:left;"> <a href="https://github.com/zouyuxin/mash_application/blob/298546692568623165a25b72aac7faf332377c70/docs/figure/EstimateCor.Rmd/unnamed-chunk-10-1.png" target="_blank">2985466</a> </td>
  <td style="text-align:left;"> zouyuxin </td>
  <td style="text-align:left;"> 2018-07-26 </td>
  </tr>
  </tbody>
  </table>
  </details>
  
-->
<p>The ROC curve:</p>
<pre class="r"><code>m.I.seq = ROC.table(data$B, m.I)
m.V.seq = ROC.table(data$B, m.V)
m.Vo.seq = ROC.table(data$B, m.Vo)
m.V1by1.seq = ROC.table(data$B, m.V1by1)
m.correct.seq = ROC.table(data$B, m.correct)</code></pre>
<p><img src="figure/EstimateCor.Rmd/unnamed-chunk-12-1.png" width="672" style="display: block; margin: auto;" /></p>
<details> <summary><em>Expand here to see past versions of unnamed-chunk-12-1.png:</em></summary>
<table style="border-collapse:separate; border-spacing:5px;">
<thead>
<tr>
<th style="text-align:left;">
Version
</th>
<th style="text-align:left;">
Author
</th>
<th style="text-align:left;">
Date
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;">
<a href="https://github.com/zouyuxin/mash_application/blob/10d4174c6f044161bf17e623f1b474618cae2114/docs/figure/EstimateCor.Rmd/unnamed-chunk-12-1.png" target="_blank">10d4174</a>
</td>
<td style="text-align:left;">
zouyuxin
</td>
<td style="text-align:left;">
2018-08-13
</td>
</tr>
<tr>
<td style="text-align:left;">
<a href="https://github.com/zouyuxin/mash_application/blob/3bfa4f502083ab1d6ba500fc0572aaf7200d6c8d/docs/figure/EstimateCor.Rmd/unnamed-chunk-12-1.png" target="_blank">3bfa4f5</a>
</td>
<td style="text-align:left;">
zouyuxin
</td>
<td style="text-align:left;">
2018-08-13
</td>
</tr>
<tr>
<td style="text-align:left;">
<a href="https://github.com/zouyuxin/mash_application/blob/298546692568623165a25b72aac7faf332377c70/docs/figure/EstimateCor.Rmd/unnamed-chunk-12-1.png" target="_blank">2985466</a>
</td>
<td style="text-align:left;">
zouyuxin
</td>
<td style="text-align:left;">
2018-07-26
</td>
</tr>
</tbody>
</table>
<p></details></p>
<p>Comparing accuracy</p>
<pre class="r"><code>rrmse = rbind(RRMSE(data$B, data$Bhat, list(m.I = m.I, m.V = m.V, m.1by1 = m.V1by1, m.true = m.correct, m.over = m.Vo)))
colnames(rrmse) = c(&#39;Identity&#39;,&#39;V.trun&#39;,&#39;V.1by1&#39;,&#39;V.true&#39;,&#39;V.over&#39;)
row.names(rrmse) = &#39;RRMSE&#39;
rrmse %&gt;% kable() %&gt;% kable_styling()</code></pre>
<table class="table" style="margin-left: auto; margin-right: auto;">
<thead>
<tr>
<th style="text-align:left;">
</th>
<th style="text-align:right;">
Identity
</th>
<th style="text-align:right;">
V.trun
</th>
<th style="text-align:right;">
V.1by1
</th>
<th style="text-align:right;">
V.true
</th>
<th style="text-align:right;">
V.over
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;">
RRMSE
</td>
<td style="text-align:right;">
0.6522463
</td>
<td style="text-align:right;">
0.5925754
</td>
<td style="text-align:right;">
0.5811472
</td>
<td style="text-align:right;">
0.5817699
</td>
<td style="text-align:right;">
0.6052702
</td>
</tr>
</tbody>
</table>
<pre class="r"><code>barplot(rrmse, ylim=c(0,(1+max(rrmse))/2), las=2, cex.names = 0.7, main=&#39;RRMSE&#39;)</code></pre>
<p><img src="figure/EstimateCor.Rmd/unnamed-chunk-14-1.png" width="672" style="display: block; margin: auto;" /></p>
<details> <summary><em>Expand here to see past versions of unnamed-chunk-14-1.png:</em></summary>
<table style="border-collapse:separate; border-spacing:5px;">
<thead>
<tr>
<th style="text-align:left;">
Version
</th>
<th style="text-align:left;">
Author
</th>
<th style="text-align:left;">
Date
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;">
<a href="https://github.com/zouyuxin/mash_application/blob/568fbe632239ed4a2ec52f4dd5f001b71d615530/docs/figure/EstimateCor.Rmd/unnamed-chunk-14-1.png" target="_blank">568fbe6</a>
</td>
<td style="text-align:left;">
zouyuxin
</td>
<td style="text-align:left;">
2018-08-13
</td>
</tr>
<tr>
<td style="text-align:left;">
<a href="https://github.com/zouyuxin/mash_application/blob/3bfa4f502083ab1d6ba500fc0572aaf7200d6c8d/docs/figure/EstimateCor.Rmd/unnamed-chunk-14-1.png" target="_blank">3bfa4f5</a>
</td>
<td style="text-align:left;">
zouyuxin
</td>
<td style="text-align:left;">
2018-08-13
</td>
</tr>
</tbody>
</table>
<p></details></p>
</div>
<div id="solution-mle" class="section level2">
<h2>Solution: MLE</h2>
<div id="k1" class="section level3">
<h3>K=1</h3>
<p>Suppose a simple extreme case <span class="math display">\[
\left(\begin{matrix} \hat{x} \\ \hat{y} \end{matrix} \right)| \left(\begin{matrix} x \\ y \end{matrix} \right) \sim N_{2}(\left(\begin{matrix} \hat{x} \\ \hat{y} \end{matrix} \right); \left(\begin{matrix} x \\ y \end{matrix} \right), \left( \begin{matrix} 1 &amp; \rho \\ \rho &amp; 1 \end{matrix}\right))
\]</span> <span class="math display">\[
\left(\begin{matrix} x \\ y \end{matrix} \right) \sim \delta_{0}
\]</span> <span class="math inline">\(\Rightarrow\)</span> <span class="math display">\[
\left(\begin{matrix} \hat{x} \\ \hat{y} \end{matrix} \right) \sim N_{2}(\left(\begin{matrix} \hat{x} \\ \hat{y} \end{matrix} \right); \left(\begin{matrix} 0 \\ 0 \end{matrix} \right), \left( \begin{matrix} 1 &amp; \rho \\ \rho &amp; 1 \end{matrix}\right))
\]</span></p>
<p><span class="math display">\[
f(\hat{x},\hat{y}) = \prod_{i=1}^{n} \frac{1}{2\pi\sqrt{1-\rho^2}} \exp \{-\frac{1}{2(1-\rho^2)}\left[ \hat{x}_{i}^2 + \hat{y}_{i}^2 - 2\rho \hat{x}_{i}\hat{y}_{i}\right]  \}
\]</span> The MLE of <span class="math inline">\(\rho\)</span>: <span class="math display">\[
\begin{align*}
l(\rho) &amp;= -\frac{n}{2}\log(1-\rho^2) - \frac{1}{2(1-\rho^2)}\left( \sum_{i=1}^{n} x_{i}^2 + y_{i}^2 - 2\rho x_{i}y_{i} \right) \\
l(\rho)&#39; &amp;= \frac{n\rho}{1-\rho^2} - \frac{\rho}{(1-\rho^2)^2} \sum_{i=1}^{n} (x_{i}^2 + y_{i}^2) + \frac{\rho^2 + 1}{(1-\rho^2)^2} \sum_{i=1}^{n} x_{i}y_{i} = 0 \\
&amp;= \rho^{3} - \rho^{2}\frac{1}{n}\sum_{i=1}^{n} x_{i}y_{i} - \left( 1- \frac{1}{n} \sum_{i=1}^{n} x_{i}^{2} + y_{i}^{2} \right) \rho - \frac{1}{n}\sum_{i=1}^{n} x_{i}y_{i} = 0 \\
l(\rho)&#39;&#39; &amp;= \frac{n(\rho^2+1)}{(1-\rho^2)^2} - \frac{1}{2}\left( \frac{8\rho^2}{(1-\rho^2)^{3}} + \frac{2}{(1-\rho^2)^2} \right)\sum_{i=1}^{n}(x_{i}^2 + y_{i}^2) + \{ \left( \frac{8\rho^2}{(1-\rho^2)^{3}} + \frac{2}{(1-\rho^2)^2} \right)\rho + \frac{4\rho}{(1-\rho^2)^2} \}\sum_{i=1}^{n}x_{i}y_{i}
\end{align*}
\]</span></p>
<p><strong>The log likelihood is not a concave function in general.</strong> The score function has either 1 or 3 real solutions.</p>
<p>Kendall and Stuart (1979) noted that at least one of the roots is real and lies in the interval [−1, 1]. However, it is possible that all three roots are real and in the admissible interval, in which case the likelihood can be evaluated at each root to determine the true maximum likelihood estimate.</p>
<p>I simulate the data with <span class="math inline">\(\rho=0.6\)</span> and plot the loglikelihood function:</p>
<p><img src="figure/EstimateCor.Rmd/unnamed-chunk-15-1.png" width="672" style="display: block; margin: auto;" /></p>
<details> <summary><em>Expand here to see past versions of unnamed-chunk-15-1.png:</em></summary>
<table style="border-collapse:separate; border-spacing:5px;">
<thead>
<tr>
<th style="text-align:left;">
Version
</th>
<th style="text-align:left;">
Author
</th>
<th style="text-align:left;">
Date
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;">
<a href="https://github.com/zouyuxin/mash_application/blob/568fbe632239ed4a2ec52f4dd5f001b71d615530/docs/figure/EstimateCor.Rmd/unnamed-chunk-15-1.png" target="_blank">568fbe6</a>
</td>
<td style="text-align:left;">
zouyuxin
</td>
<td style="text-align:left;">
2018-08-13
</td>
</tr>
</tbody>
</table>
<p></details></p>
<p><span class="math inline">\(l(\rho)&#39;\)</span> has one real solution</p>
<pre class="r"><code>polyroot(c(- sum(data$Bhat[,1]*data$Bhat[,2]),  - (n - sum(data$Bhat[,1]^2 + data$Bhat[,2]^2)), - sum(data$Bhat[,1]*data$Bhat[,2]), n))</code></pre>
<pre><code>[1] 0.6193031+0.000000i 0.0058209+1.009339i 0.0058209-1.009339i</code></pre>
</div>
<div id="in-general" class="section level3">
<h3>In general</h3>
<p>The general derivation is in <a href="EstimateCorOptim.html">estimate correlation mle</a></p>
</div>
</div>
<div id="session-information" class="section level2">
<h2>Session information</h2>
<pre class="r"><code>sessionInfo()</code></pre>
<pre><code>R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.6

Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] kableExtra_0.9.0 knitr_1.20       mashr_0.2-15     ashr_2.2-14     

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.19      highr_0.7         pillar_1.3.0     
 [4] compiler_3.5.1    git2r_0.23.0      plyr_1.8.4       
 [7] workflowr_1.1.1   R.methodsS3_1.7.1 R.utils_2.6.0    
[10] iterators_1.0.10  tools_3.5.1       digest_0.6.15    
[13] viridisLite_0.3.0 tibble_1.4.2      evaluate_0.11    
[16] lattice_0.20-35   pkgconfig_2.0.2   rlang_0.2.2      
[19] Matrix_1.2-14     foreach_1.4.4     rstudioapi_0.7   
[22] yaml_2.2.0        parallel_3.5.1    mvtnorm_1.0-8    
[25] xml2_1.2.0        httr_1.3.1        stringr_1.3.1    
[28] REBayes_1.3       hms_0.4.2         rprojroot_1.3-2  
[31] grid_3.5.1        R6_2.2.2          rmarkdown_1.10   
[34] rmeta_3.0         readr_1.1.1       magrittr_1.5     
[37] whisker_0.3-2     scales_1.0.0      backports_1.1.2  
[40] codetools_0.2-15  htmltools_0.3.6   MASS_7.3-50      
[43] rvest_0.3.2       abind_1.4-5       assertthat_0.2.0 
[46] colorspace_1.3-2  stringi_1.2.4     Rmosek_8.0.69    
[49] munsell_0.5.0     doParallel_1.0.14 pscl_1.5.2       
[52] truncnorm_1.0-8   SQUAREM_2017.10-1 crayon_1.3.4     
[55] R.oo_1.22.0      </code></pre>
</div>

<!-- Adjust MathJax settings so that all math formulae are shown using
TeX fonts only; see
http://docs.mathjax.org/en/latest/configuration.html.  This will make
the presentation more consistent at the cost of the webpage sometimes
taking slightly longer to load. Note that this only works because the
footer is added to webpages before the MathJax javascript. -->
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    "HTML-CSS": { availableFonts: ["TeX"] }
  });
</script>

<hr>
<p>
  This reproducible <a href="http://rmarkdown.rstudio.com">R Markdown</a>
  analysis was created with
  <a href="https://github.com/jdblischak/workflowr">workflowr</a> 1.1.1
</p>
<hr>


</div>
</div>

</div>

<script>

// add bootstrap table styles to pandoc tables
function bootstrapStylePandocTables() {
  $('tr.header').parent('thead').parent('table').addClass('table table-condensed');
}
$(document).ready(function () {
  bootstrapStylePandocTables();
});


</script>

<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
  (function () {
    var script = document.createElement("script");
    script.type = "text/javascript";
    script.src  = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
    document.getElementsByTagName("head")[0].appendChild(script);
  })();
</script>

</body>
</html>