123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741 |
- <!DOCTYPE html>
- <html lang="en" data-default-color-scheme=auto>
- <head><!-- hexo injector head_begin start -->
- <script defer src="https://api.limour.top/vue/0d2f95c1-755d-436b-adf8-eee12a80ed32/script.js"></script>
- <!-- hexo injector head_begin end -->
- <meta charset="UTF-8">
- <link rel="apple-touch-icon" sizes="76x76" href="https://img.limour.top/2023/08/29/64ee07361815a.webp">
- <link rel="icon" href="https://img.limour.top/2023/08/29/64ee07361815a.webp">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
- <meta http-equiv="x-ua-compatible" content="ie=edge">
-
- <meta name="theme-color" content="#2f4154">
- <meta name="author" content="Limour">
- <meta name="keywords" content="">
-
- <meta name="description" content="在分析数据集时,常常会碰到一些缺失值,如果缺失值的数量相对总体来说非常小,那么直接删除缺失值就是一种可行的方法。但某些情况下,直接删除缺失值可能会损失一些有用信息,此时就需要寻找方法来补全缺失值。 安装包 12conda create -n mice conda-forge::r-tidyverse conda-forge::r-irkernel conda-forge::r-mice conda">
-
-
-
- <title>【迁移】使用MICE包对数据缺失值进行插补 - Limour's Blog</title>
- <link rel="stylesheet" href="https://jscdn.limour.top/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css" />
- <link rel="stylesheet" href="https://jscdn.limour.top/npm/github-markdown-css@4.0.0/github-markdown.min.css" />
- <link rel="stylesheet" href="https://jscdn.limour.top/npm/hint.css@2.7.0/hint.min.css" />
- <!-- 主题依赖的图标库,不要自行修改 -->
- <!-- Do not modify the link that theme dependent icons -->
- <link rel="stylesheet" href="//at.alicdn.com/t/c/font_1749284_5i9bdhy70f8.css">
- <link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">
- <link rel="stylesheet" href="/css/main.css" />
- <link id="highlight-css" rel="stylesheet" href="/css/highlight.css" />
-
- <link id="highlight-css-dark" rel="stylesheet" href="/css/highlight-dark.css" />
-
-
- <link rel="stylesheet" href="/theme-inject/custom.css">
- <link rel="stylesheet" href="/theme-inject/iconfont.css">
- <script id="fluid-configs">
- var Fluid = window.Fluid || {};
- Fluid.ctx = Object.assign({}, Fluid.ctx)
- var CONFIG = {"hostname":"hexo.limour.top","root":"/","version":"1.9.8","typing":{"enable":false,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":"§"},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":false,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"right","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"https://jscdn.limour.top/gh/Limour-dev/Sakurairo_Vision/load_svg/inload.svg","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"follow_dnt":true,"baidu":null,"google":{"measurement_id":null},"tencent":{"sid":null,"cid":null},"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false},"umami":{"src":null,"website_id":null,"domains":null,"start_time":"2024-01-01T00:00:00.000Z","token":null,"api_server":null},"woyaola":null,"cnzz":null},"search_path":"/local-search.xml","include_content_in_search":true};
- if (CONFIG.web_analytics.follow_dnt) {
- var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
- Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
- }
- </script>
- <script src="/js/utils.js" ></script>
- <script src="/js/color-schema.js" ></script>
-
-
- <link rel="canonical" href="https://hexo.limour.top/shi-yong-MICE-bao-dui-shu-ju-que-shi-zhi-jin-hang-cha-bu"/>
- <meta name="generator" content="Hexo 7.1.1"><link rel="alternate" href="/atom.xml" title="Limour's Blog" type="application/atom+xml">
- <link rel="alternate" href="/rss2.xml" title="Limour's Blog" type="application/rss+xml">
- </head>
- <body>
-
- <header>
-
- <div class="header-inner" style="height: 70vh;">
- <nav id="navbar" class="navbar fixed-top navbar-expand-lg navbar-dark scrolling-navbar">
- <div class="container">
- <a class="navbar-brand" href="/">
- <strong>Limour's Blog</strong>
- </a>
- <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
- data-target="#navbarSupportedContent"
- aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
- <div class="animated-icon"><span></span><span></span><span></span></div>
- </button>
- <!-- Collapsible content -->
- <div class="collapse navbar-collapse" id="navbarSupportedContent">
- <ul class="navbar-nav ml-auto text-center">
-
-
-
-
-
- <li class="nav-item">
- <a class="nav-link" href="https://hexo.limour.top/" target="_self">
- <i class="iconfont icon-home-fill"></i>
- <span>Home</span>
- </a>
- </li>
-
-
-
-
-
-
- <li class="nav-item">
- <a class="nav-link" href="/archives/" target="_self">
- <i class="iconfont icon-archive-fill"></i>
- <span>Archive1</span>
- </a>
- </li>
-
-
-
-
-
-
- <li class="nav-item">
- <a class="nav-link" href="https://occdn.limour.top/archives/" target="_self">
- <i class="iconfont icon-archive-fill"></i>
- <span>Archive2</span>
- </a>
- </li>
-
-
-
-
-
-
- <li class="nav-item">
- <a class="nav-link" href="https://b.limour.top/archives/" target="_self">
- <i class="iconfont icon-archive-fill"></i>
- <span>Archive3</span>
- </a>
- </li>
-
-
-
-
-
-
- <li class="nav-item">
- <a class="nav-link" href="https://od.limour.top/" target="_self">
- <i class="iconfont icon-onedrive"></i>
- <span>Alist</span>
- </a>
- </li>
-
-
-
-
-
-
- <li class="nav-item">
- <a class="nav-link" href="https://orcid.org/0000-0001-8897-1685" target="_self">
- <i class="iconfont icon-orcid"></i>
- <span>Orcid</span>
- </a>
- </li>
-
-
-
-
-
-
- <li class="nav-item">
- <a class="nav-link" href="/links/" target="_self">
- <i class="iconfont icon-link-fill"></i>
- <span>Links</span>
- </a>
- </li>
-
-
-
-
-
-
- <li class="nav-item">
- <a class="nav-link" href="/atom.xml" target="_self">
- <i class="iconfont icon-rss"></i>
- <span>RSS</span>
- </a>
- </li>
-
-
-
- <li class="nav-item" id="search-btn">
- <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
- <i class="iconfont icon-search"></i>
- </a>
- </li>
-
-
-
- <li class="nav-item" id="color-toggle-btn">
- <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">
- <i class="iconfont icon-dark" id="color-toggle-icon"></i>
- </a>
- </li>
-
- </ul>
- </div>
- </div>
- </nav>
-
- <div id="banner" class="banner" parallax=true
- style="background: url('https://img.limour.top/2023/08/29/64ee08e108638.webp') no-repeat center center; background-size: cover;">
- <div class="full-bg-img">
- <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
- <div class="banner-text text-center fade-in-up">
- <div class="h2">
-
- <span id="subtitle">【迁移】使用MICE包对数据缺失值进行插补</span>
-
- </div>
-
-
- <div class="mt-3">
-
- <span class="post-meta mr-2">
- <i class="iconfont icon-author" aria-hidden="true"></i>
- Limour
- </span>
-
-
- <span class="post-meta">
- <i class="iconfont icon-date-fill" aria-hidden="true"></i>
- <time datetime="2022-09-10 18:08" pubdate>
- September 10, 2022 pm
- </time>
- </span>
-
- </div>
- <div class="mt-1">
-
- <span class="post-meta mr-2">
- <i class="iconfont icon-chart"></i>
-
- 1.9k words
-
- </span>
-
-
- <span class="post-meta mr-2">
- <i class="iconfont icon-clock-fill"></i>
-
-
-
- 17 mins
-
- </span>
-
-
-
- </div>
-
- </div>
-
- </div>
- </div>
- </div>
- </div>
- </header>
- <main>
-
-
- <div class="container-fluid nopadding-x">
- <div class="row nomargin-x">
- <div class="side-col d-none d-lg-block col-lg-2">
-
- </div>
- <div class="col-lg-8 nopadding-x-md">
- <div class="container nopadding-x-md" id="board-ctn">
- <div id="board">
- <article class="post-content mx-auto">
- <h1 id="seo-header">【迁移】使用MICE包对数据缺失值进行插补</h1>
-
- <p id="updated-time" class="note note-info" style="">
-
-
- Last updated on October 20, 2024 pm
-
-
- </p>
-
-
- <div class="markdown-body">
-
- <p>在分析数据集时,常常会碰到一些缺失值,如果缺失值的数量相对总体来说非常小,那么直接删除缺失值就是一种可行的方法。但某些情况下,直接删除缺失值可能会损失一些有用信息,此时就需要寻找方法来补全缺失值。</p>
- <h2 id="安装包">安装包</h2>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">conda create -n mice conda-forge::r-tidyverse conda-forge::r-irkernel conda-forge::r-mice conda-forge::r-vim<br>conda run -n mice Rscript -e <span class="hljs-string">"IRkernel::installspec(name='mice', displayname='mice')"</span><br></code></pre></td></tr></table></figure>
- <h2 id="导入数据">导入数据</h2>
- <figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><code class="hljs R">library<span class="hljs-punctuation">(</span>tidyverse<span class="hljs-punctuation">)</span><br><br>airquality <span class="hljs-operator">%>%</span> head<span class="hljs-punctuation">(</span><span class="hljs-punctuation">)</span><br>colnames<span class="hljs-punctuation">(</span>airquality<span class="hljs-punctuation">)</span> <span class="hljs-operator"><-</span> str_replace_all<span class="hljs-punctuation">(</span>colnames<span class="hljs-punctuation">(</span>airquality<span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> pattern <span class="hljs-operator">=</span> <span class="hljs-string">'\\(| |-'</span><span class="hljs-punctuation">,</span> replacement <span class="hljs-operator">=</span> <span class="hljs-string">'_'</span><span class="hljs-punctuation">)</span><br>colnames<span class="hljs-punctuation">(</span>airquality<span class="hljs-punctuation">)</span> <span class="hljs-operator"><-</span> str_replace_all<span class="hljs-punctuation">(</span>colnames<span class="hljs-punctuation">(</span>airquality<span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> pattern <span class="hljs-operator">=</span> <span class="hljs-string">'\\)'</span><span class="hljs-punctuation">,</span> replacement <span class="hljs-operator">=</span> <span class="hljs-string">''</span><span class="hljs-punctuation">)</span><br>airquality <span class="hljs-operator">%>%</span> summarise_all<span class="hljs-punctuation">(</span><span class="hljs-operator">~</span> <span class="hljs-built_in">round</span><span class="hljs-punctuation">(</span><span class="hljs-built_in">sum</span><span class="hljs-punctuation">(</span><span class="hljs-built_in">is.na</span><span class="hljs-punctuation">(</span>.<span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span> <span class="hljs-operator">/</span> <span class="hljs-built_in">length</span><span class="hljs-punctuation">(</span>.<span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> <span class="hljs-number">3</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span><br><br>airquality <span class="hljs-operator"><-</span> airquality <span class="hljs-operator">%>%</span> <br> mutate<span class="hljs-punctuation">(</span>Month <span class="hljs-operator">=</span> factor<span class="hljs-punctuation">(</span>Month<span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span> <span class="hljs-operator">%>%</span> <br> mutate<span class="hljs-punctuation">(</span>Day <span class="hljs-operator">=</span> factor<span class="hljs-punctuation">(</span>Day<span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span><br></code></pre></td></tr></table></figure>
- <h2 id="查看数据质量">查看数据质量</h2>
- <figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs R">mice<span class="hljs-operator">::</span>md.pattern<span class="hljs-punctuation">(</span>airquality<span class="hljs-punctuation">)</span><br></code></pre></td></tr></table></figure>
- <p><img src="https://img.limour.top/2024/10/17/6710857837ea4.webp" srcset="https://jscdn.limour.top/gh/Limour-dev/Sakurairo_Vision/load_svg/inload.svg" lazyload alt=""></p>
- <ol>
- <li>左边第一列,为样本数</li>
- <li>右边第一列,为累积缺失值个数,0为没有缺失。</li>
- <li>第一行可以理解为,有111条记录,所有列都有值,没有缺失值。</li>
- <li>第二行可以理解为,有35条记录,Ozone列有缺失值。</li>
- </ol>
- <figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs R">options<span class="hljs-punctuation">(</span>repr.plot.width <span class="hljs-operator">=</span> <span class="hljs-number">12</span><span class="hljs-punctuation">,</span> repr.plot.height <span class="hljs-operator">=</span> <span class="hljs-number">12</span><span class="hljs-punctuation">)</span><br>VIM<span class="hljs-operator">::</span>marginmatrix<span class="hljs-punctuation">(</span>airquality<span class="hljs-punctuation">)</span><br></code></pre></td></tr></table></figure>
- <p><img src="https://img.limour.top/2024/10/17/67109887812ea.webp" srcset="https://jscdn.limour.top/gh/Limour-dev/Sakurairo_Vision/load_svg/inload.svg" lazyload alt=""></p>
- <p>当同一侧红蓝箱线图较为接近时可认为其对应考察的另一侧变量缺失情况比较贴近完全随机缺失,这种情况下可以放心大胆地进行之后的插补,否则就不能冒然进行插补。</p>
- <figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs R">options<span class="hljs-punctuation">(</span>repr.plot.width <span class="hljs-operator">=</span> <span class="hljs-number">6</span><span class="hljs-punctuation">,</span> repr.plot.height <span class="hljs-operator">=</span> <span class="hljs-number">6</span><span class="hljs-punctuation">)</span><br>mice<span class="hljs-operator">::</span>fluxplot<span class="hljs-punctuation">(</span>airquality<span class="hljs-punctuation">)</span><br></code></pre></td></tr></table></figure>
- <p><img src="https://img.limour.top/2024/10/20/6714e14f6c365.webp" srcset="https://jscdn.limour.top/gh/Limour-dev/Sakurairo_Vision/load_svg/inload.svg" lazyload alt=""></p>
- <p>通量图可用于发现潜在的预测因子、更容易被预测的变量以及干扰插补模型的变量。一般来说,离对角线较近的变量通常比距离较远的变量关联性更好(关联性好的预测性更好),位于较低区域(尤其是左下角附近)且对后续分析不感兴趣的变量最好在插补之前从数据中删除。</p>
- <h2 id="mice包介绍">mice包介绍</h2>
- <p>mice包实现了,多变量缺失数据填补的方法,基于多元回归模型来预测,每个不完整变量由单独的模型估算,进行多重混合评估。mice包算法可以实现对于连续型,二进制,无序分类和有序分类数据的进行混合。此外,mice包可以处理连续的两级数据,并通过被动插补来保持插补之间的一致性,通过各种统计诊断图,保证插补数据的质量,该包论文在统计软件领域顶刊JSS上。(from <a href="https://hexo.limour.top/go/#aHR0cDovL2Jsb2cuZmVucy5tZS9yLW5hLW1pY2Uv" rel="noopener external nofollow noreferrer">粉丝日志</a>)</p>
- <p>对于缺失值数据的处理,用3个步骤来进行定义。</p>
- <ol>
- <li>填充:mice()函数,从一个包含缺失数据的数据框开始,然后返回一个包含多个完整数据集的对象,每个完整数据集都是通过对原始数据框中的缺失数据进行插而生成的。</li>
- <li>分析:with()函数,可依次对每个完整数据集应用统计模型,分析填充的结果。</li>
- <li>优化:pool()函数,将这些单独的分析结果整合为一组结果,最终模型的标准误和p值,都将准确地反映出由于缺失值和多重插补而产生的不确定性。</li>
- </ol>
- <figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs citaction">van Buuren, S., & Groothuis-Oudshoorn, K. (2011). mice: Multivariate Imputation by Chained Equations in R. Journal of Statistical Software, 45(3), 1–67. https://doi.org/10.18637/jss.v045.i03<br></code></pre></td></tr></table></figure>
- <h2 id="进行迭代插补">进行迭代插补</h2>
- <figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><code class="hljs R"><span class="hljs-comment"># 这里认为日期对于其他变量无相关关系,因此令变量Month与变量Day不参与对其他变量的拟合插补过程</span><br>irrelevant_variable <span class="hljs-operator"><-</span> <span class="hljs-built_in">c</span><span class="hljs-punctuation">(</span><span class="hljs-string">'Month'</span><span class="hljs-punctuation">,</span> <span class="hljs-string">'Day'</span><span class="hljs-punctuation">)</span><br>predictorMatrix <span class="hljs-operator"><-</span> mice<span class="hljs-operator">::</span>quickpred<span class="hljs-punctuation">(</span>airquality<span class="hljs-punctuation">,</span> mincor <span class="hljs-operator">=</span> <span class="hljs-number">0.1</span><span class="hljs-punctuation">,</span> minpuc <span class="hljs-operator">=</span> <span class="hljs-number">0</span><span class="hljs-punctuation">,</span> include<span class="hljs-operator">=</span><span class="hljs-string">""</span><span class="hljs-punctuation">,</span> exclude <span class="hljs-operator">=</span> irrelevant_variable<span class="hljs-punctuation">,</span> method <span class="hljs-operator">=</span> <span class="hljs-string">"spearman"</span><span class="hljs-punctuation">)</span><br><span class="hljs-comment"># mincor:向量或矩阵,指定最小的阈值,利用被预测和预测变量的相关系数绝对值大于等于该值的的预测变量进行插补,默认为0.1;</span><br><span class="hljs-comment"># minpuc:指定可用个案数的最小比例;</span><br><span class="hljs-comment"># include:指定必须包含的变量;exclude:指定排除的变量;</span><br><span class="hljs-comment"># method指定相关的类型,有pearson、kendall和spearman。</span><br><br>predictorMatrix <span class="hljs-operator">%>%</span> as.data.frame <span class="hljs-operator">%>%</span> sapply<span class="hljs-punctuation">(</span><span class="hljs-built_in">sum</span><span class="hljs-punctuation">)</span><br>predictorMatrix <span class="hljs-operator">%>%</span> t <span class="hljs-operator">%>%</span> as.data.frame <span class="hljs-operator">%>%</span> sapply<span class="hljs-punctuation">(</span><span class="hljs-built_in">sum</span><span class="hljs-punctuation">)</span><br>predictorMatrix<br></code></pre></td></tr></table></figure>
- <figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><code class="hljs R"><span class="hljs-comment">#初始化插补模型,这里最大迭代次数选0是为了取得未开始插补的朴素模型参数</span><br>init <span class="hljs-operator"><-</span> mice<span class="hljs-operator">::</span>mice<span class="hljs-punctuation">(</span>airquality<span class="hljs-punctuation">,</span> predictorMatrix <span class="hljs-operator">=</span> predictorMatrix<span class="hljs-punctuation">,</span> maxit<span class="hljs-operator">=</span><span class="hljs-number">0</span><span class="hljs-punctuation">,</span> seed<span class="hljs-operator">=</span><span class="hljs-number">1337</span><span class="hljs-punctuation">)</span><br>init<span class="hljs-operator">$</span>loggedEvents <span class="hljs-comment"># 看是否有共线性等事件</span><br><br><span class="hljs-comment"># 修改每一个变量对应的插补方式</span><br>init<span class="hljs-operator">$</span>method<span class="hljs-punctuation">[</span><span class="hljs-built_in">c</span><span class="hljs-punctuation">(</span><span class="hljs-string">'Ozone'</span><span class="hljs-punctuation">,</span> <span class="hljs-string">'Solar.R'</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">]</span> <span class="hljs-operator">=</span> <span class="hljs-string">'cart'</span> <span class="hljs-comment"># 决策树回归</span><br><span class="hljs-comment"># meth:指定数据中每一列的输入方法。</span><br><span class="hljs-comment"># 1)数值型数据适用 pmm;</span><br><span class="hljs-comment"># 2)二分类数据适用 logreg;</span><br><span class="hljs-comment"># 3)无序多类别数据适用 ployreg;</span><br><span class="hljs-comment"># 4)有序多分类变量适用 polr。</span><br><span class="hljs-comment"># 默认方法为 pmm </span><br><span class="hljs-comment"># Can be either a single string, or a vector of strings with length length(blocks), specifying the imputation method to be used for each column in data.</span><br><br><span class="hljs-comment">#利用修改后的参数组合来进行拟合插补</span><br>imputed <span class="hljs-operator"><-</span> mice<span class="hljs-punctuation">(</span>airquality<span class="hljs-punctuation">,</span> method <span class="hljs-operator">=</span> init<span class="hljs-operator">$</span>method<span class="hljs-punctuation">,</span> predictorMatrix <span class="hljs-operator">=</span> init<span class="hljs-operator">$</span>predictorMatrix<span class="hljs-punctuation">,</span> m<span class="hljs-operator">=</span><span class="hljs-number">5</span><span class="hljs-punctuation">,</span> seed<span class="hljs-operator">=</span><span class="hljs-number">1337</span><span class="hljs-punctuation">,</span> maxit<span class="hljs-operator">=</span><span class="hljs-number">500</span><span class="hljs-punctuation">)</span><br><span class="hljs-comment"># m: 生成插补矩阵的个数,mice最开始基于gibbs采样从原始数据出发为每个缺失值生成初始值以供之后迭代使用,而m则控制具体要生成的完整初始数据框个数,在整个插补过程最后需要利用这m个矩阵融合出最终的插补结果,若m=1,则唯一的矩阵就是插补的结果;</span><br><br>options<span class="hljs-punctuation">(</span>repr.plot.width <span class="hljs-operator">=</span> <span class="hljs-number">6</span><span class="hljs-punctuation">,</span> repr.plot.height <span class="hljs-operator">=</span> <span class="hljs-number">6</span><span class="hljs-punctuation">)</span><br>plot<span class="hljs-punctuation">(</span>imputed<span class="hljs-punctuation">)</span><br><span class="hljs-comment"># 结果显示的是插补值得均值(左)和标准差(右),</span><br><span class="hljs-comment"># 如果线迹充分混合且没有趋势,表明算法收敛良好,一般默认的5次迭代就可以达到很好的效果。</span><br></code></pre></td></tr></table></figure>
- <p><img src="https://img.limour.top/2024/10/20/6714e39068a1b.webp" srcset="https://jscdn.limour.top/gh/Limour-dev/Sakurairo_Vision/load_svg/inload.svg" lazyload alt=""></p>
- <h2 id="选择合适的插补(看图)">选择合适的插补(看图)</h2>
- <figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs R">mice<span class="hljs-operator">::</span>densityplot<span class="hljs-punctuation">(</span>imputed<span class="hljs-punctuation">,</span> <span class="hljs-operator">~</span> Ozone <span class="hljs-operator">+</span> Solar.R <span class="hljs-operator">|</span> .imp<span class="hljs-punctuation">)</span><br><span class="hljs-comment"># 蓝色为原始数据的分布,第一幅红色图为一重插补,以此类推,选择最符合的</span><br></code></pre></td></tr></table></figure>
- <p><img src="https://img.limour.top/2024/10/17/67109454deedb.webp" srcset="https://jscdn.limour.top/gh/Limour-dev/Sakurairo_Vision/load_svg/inload.svg" lazyload alt=""></p>
- <figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs R">mice<span class="hljs-operator">::</span>densityplot<span class="hljs-punctuation">(</span>imputed<span class="hljs-punctuation">,</span> <span class="hljs-operator">~</span> Ozone <span class="hljs-operator">+</span> Solar.R <span class="hljs-operator">|</span> .imp <span class="hljs-operator">==</span> <span class="hljs-number">5</span><span class="hljs-punctuation">)</span><br><span class="hljs-comment"># 具体查看某一重插补,蓝色为原始数据的分布,右侧为选择的插补。</span><br></code></pre></td></tr></table></figure>
- <p><img src="https://img.limour.top/2024/10/17/67109453a2dbd.webp" srcset="https://jscdn.limour.top/gh/Limour-dev/Sakurairo_Vision/load_svg/inload.svg" lazyload alt=""></p>
- <h2 id="导出插补后的数据">导出插补后的数据</h2>
- <figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs R">f_mice_complete <span class="hljs-operator"><-</span> <span class="hljs-keyword">function</span><span class="hljs-punctuation">(</span>l_data<span class="hljs-punctuation">,</span> l_imputed<span class="hljs-punctuation">,</span> l_colname<span class="hljs-punctuation">,</span> action<span class="hljs-punctuation">)</span><span class="hljs-punctuation">{</span><br> l_data<span class="hljs-punctuation">[</span>rownames<span class="hljs-punctuation">(</span>l_imputed<span class="hljs-operator">$</span>imp<span class="hljs-punctuation">[[</span>l_colname<span class="hljs-punctuation">]</span><span class="hljs-punctuation">]</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> l_colname<span class="hljs-punctuation">]</span> <span class="hljs-operator"><-</span> l_imputed<span class="hljs-operator">$</span>imp<span class="hljs-punctuation">[[</span>l_colname<span class="hljs-punctuation">]</span><span class="hljs-punctuation">]</span><span class="hljs-punctuation">[</span>action<span class="hljs-punctuation">]</span><br> <span class="hljs-built_in">return</span><span class="hljs-punctuation">(</span>l_data<span class="hljs-punctuation">)</span><br><span class="hljs-punctuation">}</span><br>Data <span class="hljs-operator"><-</span> imputed<span class="hljs-operator">$</span>data<br>Data <span class="hljs-operator"><-</span> f_mice_complete<span class="hljs-punctuation">(</span>Data<span class="hljs-punctuation">,</span> imputed<span class="hljs-punctuation">,</span> <span class="hljs-string">'Ozone'</span><span class="hljs-punctuation">,</span> <span class="hljs-number">4</span><span class="hljs-punctuation">)</span><br><span class="hljs-comment"># 根据检验统计量,我们选择以第4次的结果做为Ozoned的填充,获得填充后的数据集。</span><br>Data <span class="hljs-operator"><-</span> f_mice_complete<span class="hljs-punctuation">(</span>Data<span class="hljs-punctuation">,</span> imputed<span class="hljs-punctuation">,</span> <span class="hljs-string">'Solar.R'</span><span class="hljs-punctuation">,</span> <span class="hljs-number">2</span><span class="hljs-punctuation">)</span><br><span class="hljs-comment"># 根据检验统计量,我们选择以第2次的结果做为Solar.R的填充,获得填充后的数据集。</span><br></code></pre></td></tr></table></figure>
- <h2 id="插补的不确定性">插补的不确定性</h2>
- <figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs R">fit1 <span class="hljs-operator"><-</span> with<span class="hljs-punctuation">(</span>imputed<span class="hljs-punctuation">,</span> stats<span class="hljs-operator">::</span>lm<span class="hljs-punctuation">(</span>formula<span class="hljs-punctuation">(</span><span class="hljs-string">'Ozone ~ Solar.R + Wind + Temp'</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span><br>fit2 <span class="hljs-operator"><-</span> with<span class="hljs-punctuation">(</span>imputed<span class="hljs-punctuation">,</span> stats<span class="hljs-operator">::</span>lm<span class="hljs-punctuation">(</span>formula<span class="hljs-punctuation">(</span><span class="hljs-string">'Solar.R ~ Ozone + Wind + Temp'</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span><br>mice<span class="hljs-operator">::</span>pool.r.squared<span class="hljs-punctuation">(</span>fit1<span class="hljs-punctuation">)</span><br>mice<span class="hljs-operator">::</span>pool.r.squared<span class="hljs-punctuation">(</span>fit2<span class="hljs-punctuation">)</span><br><span class="hljs-comment"># est, 合并的R^2,估计值</span><br><span class="hljs-comment"># fmi,缺少信息的部分,越小越好</span><br></code></pre></td></tr></table></figure>
- <h2 id="插补数据集分析">插补数据集分析</h2>
- <figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><code class="hljs R">fit <span class="hljs-operator"><-</span> with<span class="hljs-punctuation">(</span>imputed<span class="hljs-punctuation">,</span> ...<span class="hljs-punctuation">)</span> <span class="hljs-comment"># 对插补后的每个数据集都进行模型拟合</span><br><span class="hljs-comment"># ... 为用来设定应用于m个插补数据集的统计分析方法,比如 lasso</span><br><span class="hljs-comment"># 理论上,只要函数符合R中的coeff方法的准则规范,用其进行多次插补后的结果都可以用pool函数进行汇总,</span><br><span class="hljs-comment"># 而且pool.scalar函数可以“手动”汇总m个重复完整数据的单变量分析估计值。</span><br><br>est <span class="hljs-operator"><-</span> pool<span class="hljs-punctuation">(</span>fit<span class="hljs-punctuation">)</span> <span class="hljs-comment"># 汇总分析结果</span><br><span class="hljs-comment"># 结果中几个参数解释如下:</span><br><span class="hljs-comment"># m:插补次数;ubar:插补组内方差的均值;</span><br><span class="hljs-comment"># b:插补间方差;</span><br><span class="hljs-comment"># t:合并估计的总方差(笔者觉得应该是标准误的平方;</span><br><span class="hljs-comment"># dfcom:插补数据集的自由度;</span><br><span class="hljs-comment"># df:假设检验的残余自由度;</span><br><span class="hljs-comment"># riv:因缺失导致的方差相对增加;</span><br><span class="hljs-comment"># lamba:由于缺失而导致的总方差的比例;</span><br><span class="hljs-comment"># fmi:因缺失导致的信息(系数)丢失比例。</span><br><br><span class="hljs-comment"># 参考:https://mp.weixin.qq.com/mp/appmsgalbum?__biz=MzIzNjk2NDg4NA==&action=getalbum&album_id=2677603372061081601&subscene=159&subscene=190</span><br></code></pre></td></tr></table></figure>
- <h2 id="插补的环境">插补的环境</h2>
- <figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs R">date<span class="hljs-punctuation">(</span><span class="hljs-punctuation">)</span><br><span class="hljs-keyword">for</span> <span class="hljs-punctuation">(</span>packagename <span class="hljs-keyword">in</span> <span class="hljs-punctuation">(</span>.packages<span class="hljs-punctuation">(</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">{</span><br> print<span class="hljs-punctuation">(</span>packageDescription<span class="hljs-punctuation">(</span>packagename<span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span><br><span class="hljs-punctuation">}</span><br></code></pre></td></tr></table></figure>
-
- </div>
-
- <hr/>
- <div>
- <div class="post-metas my-3">
-
-
- <div class="post-meta">
- <i class="iconfont icon-tags"></i>
-
- <a href="/tags/mice/" class="print-no-link">#MICE</a>
-
- <a href="/tags/r/" class="print-no-link">#R</a>
-
- </div>
-
- </div>
-
-
- <div class="license-box my-3">
- <div class="license-title">
- <div>【迁移】使用MICE包对数据缺失值进行插补</div>
- <div>https://hexo.limour.top/shi-yong-MICE-bao-dui-shu-ju-que-shi-zhi-jin-hang-cha-bu</div>
- </div>
- <div class="license-meta">
-
- <div class="license-meta-item">
- <div>Author</div>
- <div>Limour</div>
- </div>
-
-
- <div class="license-meta-item license-meta-date">
- <div>Posted on</div>
- <div>September 10, 2022</div>
- </div>
-
-
- <div class="license-meta-item license-meta-date">
- <div>Updated on</div>
- <div>October 20, 2024</div>
- </div>
-
-
- <div class="license-meta-item">
- <div>Licensed under</div>
- <div>
-
-
-
- <a class="print-no-link" target="_blank" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">
- <span class="hint--top hint--rounded" aria-label="BY - Attribution">
- <i class="iconfont icon-cc-by"></i>
- </span>
- </a>
-
- <a class="print-no-link" target="_blank" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">
- <span class="hint--top hint--rounded" aria-label="NC - Non-commercial">
- <i class="iconfont icon-cc-nc"></i>
- </span>
- </a>
-
- <a class="print-no-link" target="_blank" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">
- <span class="hint--top hint--rounded" aria-label="SA - Share-alike">
- <i class="iconfont icon-cc-sa"></i>
- </span>
- </a>
-
-
- </div>
- </div>
-
- </div>
- <div class="license-icon iconfont"></div>
- </div>
-
- <div class="post-prevnext my-3">
- <article class="post-prev col-6">
-
-
- <a href="/R-jie-jue-dao-chu-PDF-shi-de-zi-ti-wen-ti" title="【迁移】R解决导出PDF时的字体问题">
- <i class="iconfont icon-arrowleft"></i>
- <span class="hidden-mobile">【迁移】R解决导出PDF时的字体问题</span>
- <span class="visible-mobile">Previous</span>
- </a>
-
- </article>
- <article class="post-next col-6">
-
-
- <a href="/shi-yong-limma-bao-jin-hang-cha-yi-ji-yin-fen-xi" title="【迁移】使用limma包进行差异基因分析">
- <span class="hidden-mobile">【迁移】使用limma包进行差异基因分析</span>
- <span class="visible-mobile">Next</span>
- <i class="iconfont icon-arrowright"></i>
- </a>
-
- </article>
- </div>
-
- </div>
-
-
-
- <article id="comments" lazyload>
-
- <div id="waline"></div>
- <script type="text/javascript">
- Fluid.utils.loadComments('#waline', function() {
- Fluid.utils.createCssLink('https://cdn.staticfile.org/waline/2.15.5/waline.css')
- Fluid.utils.createScript('https://cdn.staticfile.org/waline/2.15.5/waline.js', function() {
- var options = Object.assign(
- {"serverURL":"https://comments.limour.top","path":"window.location.pathname","meta":["nick","mail","link"],"requiredMeta":["nick"],"lang":"zh-CN","emoji":["https://jscdn.limour.top/gh/walinejs/emojis/weibo"],"dark":"html[data-user-color-scheme=\"dark\"]","wordLimit":0,"pageSize":10},
- {
- el: '#waline',
- path: window.location.pathname
- }
- )
- Waline.init(options);
- Fluid.utils.waitElementVisible('#waline .vcontent', () => {
- var imgSelector = '#waline .vcontent img:not(.vemoji)';
- Fluid.plugins.imageCaption(imgSelector);
- Fluid.plugins.fancyBox(imgSelector);
- })
- });
- });
- </script>
- <noscript>Please enable JavaScript to view the comments</noscript>
- </article>
-
- </article>
- </div>
- </div>
- </div>
- <div class="side-col d-none d-lg-block col-lg-2">
-
- <aside class="sidebar" style="margin-left: -1rem">
- <div id="toc">
- <p class="toc-header">
- <i class="iconfont icon-list"></i>
- <span>Table of Contents</span>
- </p>
- <div class="toc-body" id="toc-body"></div>
- </div>
- </aside>
- </div>
- </div>
- </div>
-
-
-
-
-
-
- <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
- <i class="iconfont icon-arrowup" aria-hidden="true"></i>
- </a>
-
-
- <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
- aria-hidden="true">
- <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
- <div class="modal-content">
- <div class="modal-header text-center">
- <h4 class="modal-title w-100 font-weight-bold">Search</h4>
- <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- </div>
- <div class="modal-body mx-3">
- <div class="md-form mb-5">
- <input type="text" id="local-search-input" class="form-control validate">
- <label data-error="x" data-success="v" for="local-search-input">Keyword</label>
- </div>
- <div class="list-group" id="local-search-result"></div>
- </div>
- </div>
- </div>
- </div>
-
-
- </main>
- <footer>
- <div class="footer-inner">
-
- <div class="footer-content">
- <a target="_blank" rel="nofollow noopener" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=43130202000203"><img src="https://img.limour.top/2023/08/27/64eadeb81d6a0.webp" srcset="https://jscdn.limour.top/gh/Limour-dev/Sakurairo_Vision/load_svg/inload.svg" lazyload>湘公网安备43130202000203号 </a> <a target="_blank" rel="nofollow noopener" href="https://beian.miit.gov.cn/">湘ICP备20008299号 </a> <a target="_blank" rel="nofollow noopener" href="https://icp.gov.moe/?keyword=20210128">萌ICP备20210128号</a> <br> <a href="https://www.foreverblog.cn/" target="_blank"> <img src="https://img.foreverblog.cn/logo_en_default.png" srcset="https://jscdn.limour.top/gh/Limour-dev/Sakurairo_Vision/load_svg/inload.svg" lazyload alt="" style="width:auto;height:24px"> </a> <br> <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/limour-blog/limour-blog.github.io" target="_blank" rel="nofollow noopener"><span>SRC</span></a> <i class="iconfont icon-love"></i> <a href="https://web.archive.org/web/20231130095837/https://effectiveacceleration.tech/" target="_blank" rel="nofollow noopener"><span>e/Acc</span></a>
- </div>
-
-
-
- </div>
- </footer>
- <!-- Scripts -->
-
- <script src="https://jscdn.limour.top/npm/nprogress@0.2.0/nprogress.min.js" ></script>
- <link rel="stylesheet" href="https://jscdn.limour.top/npm/nprogress@0.2.0/nprogress.min.css" />
- <script>
- NProgress.configure({"showSpinner":false,"trickleSpeed":100})
- NProgress.start()
- window.addEventListener('load', function() {
- NProgress.done();
- })
- </script>
- <script src="https://jscdn.limour.top/npm/jquery@3.6.4/dist/jquery.min.js" ></script>
- <script src="https://jscdn.limour.top/npm/bootstrap@4.6.1/dist/js/bootstrap.min.js" ></script>
- <script src="/js/events.js" ></script>
- <script src="/js/plugins.js" ></script>
-
- <script src="/js/img-lazyload.js" ></script>
-
-
- <script>
- Fluid.utils.createScript('https://jscdn.limour.top/npm/tocbot@4.20.1/dist/tocbot.min.js', function() {
- var toc = jQuery('#toc');
- if (toc.length === 0 || !window.tocbot) { return; }
- var boardCtn = jQuery('#board-ctn');
- var boardTop = boardCtn.offset().top;
- window.tocbot.init(Object.assign({
- tocSelector : '#toc-body',
- contentSelector : '.markdown-body',
- linkClass : 'tocbot-link',
- activeLinkClass : 'tocbot-active-link',
- listClass : 'tocbot-list',
- isCollapsedClass: 'tocbot-is-collapsed',
- collapsibleClass: 'tocbot-is-collapsible',
- scrollSmooth : true,
- includeTitleTags: true,
- headingsOffset : -boardTop,
- }, CONFIG.toc));
- if (toc.find('.toc-list-item').length > 0) {
- toc.css('visibility', 'visible');
- }
- Fluid.events.registerRefreshCallback(function() {
- if ('tocbot' in window) {
- tocbot.refresh();
- var toc = jQuery('#toc');
- if (toc.length === 0 || !tocbot) {
- return;
- }
- if (toc.find('.toc-list-item').length > 0) {
- toc.css('visibility', 'visible');
- }
- }
- });
- });
- </script>
- <script src=https://lib.baomitu.com/clipboard.js/2.0.11/clipboard.min.js></script>
- <script>Fluid.plugins.codeWidget();</script>
-
- <script>
- Fluid.utils.createScript('https://jscdn.limour.top/npm/anchor-js@4.3.1/anchor.min.js', function() {
- window.anchors.options = {
- placement: CONFIG.anchorjs.placement,
- visible : CONFIG.anchorjs.visible
- };
- if (CONFIG.anchorjs.icon) {
- window.anchors.options.icon = CONFIG.anchorjs.icon;
- }
- var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
- var res = [];
- for (var item of el) {
- res.push('.markdown-body > ' + item.trim());
- }
- if (CONFIG.anchorjs.placement === 'left') {
- window.anchors.options.class = 'anchorjs-link-left';
- }
- window.anchors.add(res.join(', '));
- Fluid.events.registerRefreshCallback(function() {
- if ('anchors' in window) {
- anchors.removeAll();
- var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
- var res = [];
- for (var item of el) {
- res.push('.markdown-body > ' + item.trim());
- }
- if (CONFIG.anchorjs.placement === 'left') {
- anchors.options.class = 'anchorjs-link-left';
- }
- anchors.add(res.join(', '));
- }
- });
- });
- </script>
- <script>Fluid.plugins.imageCaption();</script>
- <script src="/js/local-search.js" ></script>
- <!-- 主题的启动项,将它保持在最底部 -->
- <!-- the boot of the theme, keep it at the bottom -->
- <script src="/js/boot.js" ></script>
-
- <noscript>
- <div class="noscript-warning">Blog works best with JavaScript enabled</div>
- </noscript>
- <!-- hexo injector body_end start -->
- <script defer src="/theme-inject/timeliness.js"></script>
- <!-- hexo injector body_end end --></body>
- </html>
|