<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Home on Drug Base</title>
    <link>/</link>
    <description>Recent content in Home on Drug Base</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 14 Mar 2019 00:00:00 +0000</lastBuildDate>
    
	<atom:link href="/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>T Distribution</title>
      <link>/post/2019/03/14/t-distribution/</link>
      <pubDate>Thu, 14 Mar 2019 00:00:00 +0000</pubDate>
      
      <guid>/post/2019/03/14/t-distribution/</guid>
      <description>The T Distibution Percentile Table is as below:</description>
    </item>
    
    <item>
      <title>趋势分析自动化</title>
      <link>/post/2019/02/21/trendautomation/</link>
      <pubDate>Thu, 21 Feb 2019 00:00:00 +0000</pubDate>
      
      <guid>/post/2019/02/21/trendautomation/</guid>
      <description>趋势分析的两大类：  在药品质量管理活动中，我们往往有很多的数据需要进行趋势分析，并起草报告。例如“年度产品质量回顾”。 另外，我们可能往往还需要有一个方便的方式来更快速的以更高频次访问数据。例如：一个电子系统，能自动生成我们想看的图形。  对于趋势分析报告来说，同时也可以基于第2条，因为一个方便的获取趋势分析图形的途径，能让我们更快速的完成报告。
 想象一下以下场景：
不断的点点点……呀，出来一张趋势图，copy, paste。然后 继续点点点……呀，又出来一张趋势图，copy, paste。然后……
咦？有张图做错了，重新点点点……呀，出来了，copy, paste……
呼，终于弄完了……
 这里，一方面，我们只能靠手工去生成图形，另一方面，手工操作容易犯错，第三方面，错了以后纠正的时间和操作成本高。
就像这篇文章里提到的一样,&amp;ldquo;all result from data should be reproducible&amp;rdquo;。这里一方面是指结果要容易重现，另一方面是指结果要可以重现。（当你面对一个结果的时候，鬼知道做这个结果的人都做了什么具体的操作）
本文章的目的： 所以，本文就着重在两个方面来讲：
 趋势分析自动化：用于日常的高频快速趋势图。 报告生成自动化：用于可重复结果的报告的快速生成。  利用趋势分析自动化，自动生成图形。 当你某个结果错了的时候，鼠标点几个，改一下设置，直接重新生成即可。   GMP关于年度产品质量回顾的要求 根据GMP第八节，应当按照操作规程，每年对所有生产的药品按品种进行产品质量回顾分析，以确认工艺稳定可靠，以及原辅料、成品现行质量标准的适用性，及时发现不良趋势，确定产品及工艺改进的方向。应当考虑以往回顾分析的历史数据，还应当对产品质量回顾分析的有效性进行自检。
根据GMP要求，我们每年都会做年度产品质量回顾，同时，趋势分析也是其中比较重要的一个方面，但是在这个过程中往往遇到的比较多的问题：
 SPC中，连续多点上升或下降，发生在好几个月前，调查无从下手。 SPC中，个别点较高，调查无从下手。  往往这时，我是我们最为苦恼的时候。
解决办法 有没有什么解决办法呢？有！那就是趋势分析自动化：
 它不但能让我们日常在短时间内能做出趋势图，方便我们日常高频次的去非正式回顾。 还可以以GMP用途，作为日常趋势回顾，来配合其它的比如限度评估的策略。  下面我们来展示几种软件的趋势分析自动化的示例。
示例数据 本贴所有数据均使用此数据：
点此下载
R语言：Utility Trend Analysis Application 我开发了一个基于R语言的数据分析电子系统，它是一个网页应用。目前没有帐号控制，但是大家可以作为非GMP用途用作日常查看趋势图。总的来说还是非常方便的。
地址：http://apps.drugqm.com:3838/sample-apps/Trend_Automation/
分析数据范围：公用工程系统数据，包括总需氧菌，电导，TOC
使用介绍： 趋势分析自动化  首先打开网址，如图，点击OK或弹出窗口外部区域，即可关闭弹出窗口：   然后点击顶部导航栏的Water-WFO 或者 Water-PW，这里点击Water-PW。点击Browse上传文件（上面的示例文件或者自己的数据按示例文件整理。注意如果使用本电子系统，示例文件的工作薄名和列名不能修改，内容可以修改。），然后选择日期范围，点击Apply。右侧即显示图形。  如果想不显示所有点，只想显示其中一部分，则点击Individual，然后下面会出现一个文本框，点击一下，则可以选择数据中包含的点。确认日期范围，所有筛选均选择完后，点击Apply。图形则会自动更新。</description>
    </item>
    
    <item>
      <title>Add grid element into ggplot2 plot</title>
      <link>/post/2019/05/25/add-grid-element-into-ggplot2-plot/</link>
      <pubDate>Sat, 25 May 2019 00:00:00 +0000</pubDate>
      
      <guid>/post/2019/05/25/add-grid-element-into-ggplot2-plot/</guid>
      <description>This is a demo to introduce how to add grid element into ggplot2 visualization plot.
library(ggplot2) library(grid) ggplot(mtcars,aes(x=mpg,y=wt))+geom_point() current.vpTree() downViewport(&amp;quot;panel.7-5-7-5&amp;quot;) pushViewport(dataViewport(mtcars$mpg,mtcars$wt)) grid.text(x=12.5,y=4.5,default.units = &amp;quot;native&amp;quot;,label=&amp;quot;Jonie&amp;quot;,just=c(&amp;quot;left&amp;quot;,&amp;quot;top&amp;quot;)) grid.points(x=12.5,y=4.5,gp=gpar(col=&amp;quot;red&amp;quot;),default.units = &amp;quot;native&amp;quot;) </description>
    </item>
    
    <item>
      <title>基于Minitab, JMP, SPSS, R做回归分析</title>
      <link>/post/2019/04/03/regression-analysis-with-minitab-jmp-and-r/</link>
      <pubDate>Wed, 03 Apr 2019 00:00:00 +0000</pubDate>
      
      <guid>/post/2019/04/03/regression-analysis-with-minitab-jmp-and-r/</guid>
      <description>在稳定性实验考察的数据分析中，用的最多的往往是一般线性模型，现在软件选择这么多，该如何区分一些参数呢？下面做简要介绍。
Type：检验的平方和  I：序贯型，嵌套设计 II：平衡设计，仅主效应 III：调整型 IV：不完整数据  Contrasts(对比):  Minitab/JMP无此项 R/SPSS有。   R中: options(contrasts=c(unordered=&amp;quot;contr.treatment&amp;quot;,ordered=&amp;quot;contr.poly&amp;quot;))为默认选项。此选项在方差分析或回归分析建模时，如果有因子，可以使用此参数。第一个是无序因子的参数，第二个是有序因子的参数。同时，也可以通过在建模时指定contrasts参数。比如td_fit&amp;lt;-lm(Potency~Lot*Time,data=td,contrasts = list(Lot=&amp;quot;contr.sum&amp;quot;))
  R（系数对比）:
  首先介绍一下系数对比。
- contr.helmert: - contr.poly - contr.SAS: SPSS默认使用此对比方式，设置此项时，R语言返回结果与SPSS的参数估计值相同。 - contr.sum: JMP默认使用此对比方式，设置此项时，R语言返回结果与JMP的协变量，交互效应，截距参数 估计值相同。 - contr.treatment：Minitab默认使用此对比方式，设置此项时，R语言返回结果与Minitab的参数估计值相 同。   R(方差分析表）  方差分析表来讲，Minitab, JMP, SPSS在模型,误差,合计上一致。但回归项下各主效应和交互效应的平方和不同。
- contr.helmert/contr.sum/contr.poly:设置此项时，R语言返回结果与SPSS的参数估计值相同。 - contr.SAS: 无具体描述 - contr.treatment：无具体描述  结果输出对比 (R vs JMP) 文件下载：
JMP 文件
CSV 数据文件
JMP的分析结果如下
R Code
 td&amp;lt;-read.csv(&amp;rdquo;~/regression_interactive.csv&amp;rdquo;) td$time&amp;lt;-scale(td$Time,scale = FALSE,center = TRUE) td_fit&amp;lt;-lm(Potency~time,data=td,contrasts=list(Batch=&amp;ldquo;contr.</description>
    </item>
    
    <item>
      <title>Interactive: JMP and R</title>
      <link>/post/2019/04/01/interactive-jmp-and-r/</link>
      <pubDate>Mon, 01 Apr 2019 00:00:00 +0000</pubDate>
      
      <guid>/post/2019/04/01/interactive-jmp-and-r/</guid>
      <description>General Summary There&amp;rsquo;s many statistical analysis software, jmp and R are two of them.
R input JMP file Also, there&amp;rsquo;s many ways to import data from other format to R, but there&amp;rsquo;s no directly way to import jmp data into R.
 library(RDCOMClient)
jmp &amp;lt;- COMCreate(&amp;ldquo;JMP.Application&amp;rdquo;)
doc = jmp$OpenDocument(&amp;ldquo;C:/Demo.jmp&amp;rdquo;)
doc$SaveAs(&amp;ldquo;d:/Demo.csv&amp;rdquo;)
td&amp;lt;-read.csv(&amp;ldquo;d:/Demo.csv&amp;rdquo;)
head(td)
file.remove(&amp;ldquo;d:/Demo.csv&amp;rdquo;)
 JMP call R JMP can also call R and return the calculated result or graphics to JMP.</description>
    </item>
    
    <item>
      <title>Kernel Quantile Estimation</title>
      <link>/post/2019/03/31/kernel-quantile-estimation/</link>
      <pubDate>Sun, 31 Mar 2019 00:00:00 +0000</pubDate>
      
      <guid>/post/2019/03/31/kernel-quantile-estimation/</guid>
      <description>Firstly, let&amp;rsquo;s generate a dataset with continous data. set.seed(1) (rand_data&amp;lt;-round(c(rnorm(5,10,2),rnorm(5,80,4)),0))  ## [1] 9 10 8 13 11 77 82 83 82 79  JMP We can use JMP to fit the smooth curve model in JMP which has another name Kernel Density Estimation. Then we can use this model to calculate the quantile.
R Of course, you have another choice to finish this work with R. there&amp;rsquo;re sereval ways to do this.</description>
    </item>
    
    <item>
      <title>Data Organization</title>
      <link>/post/2019/02/21/dataorganization/</link>
      <pubDate>Thu, 21 Feb 2019 00:00:00 +0000</pubDate>
      
      <guid>/post/2019/02/21/dataorganization/</guid>
      <description>格式要求  没有空行或空列 没有合并单元格 数值性数据不应包含符号，比如百分号。 重复内容应该包含相同内容。 每个单元格只填写一个信息元素。 只有一个标题行。 相同变量的所有元素应该在同一列。 前后一致。 数据值和非数据型数据不在同一列混放。 缺失值留空，不要用N/A（可以用NA）。 始终如一的保持输入格式要求，比如特殊字符，空值，大小写，等等 不用格式表示特殊意义，如需要，可以加一列字段表示。比如，性别用颜色进行区分，我们可以加一列，并分别用M表示男性，用F表示女性。  稳定性数据格式 原始格式
修改后
环境监测数据 修改前
修改后-1
可以使用这种格式，也是比较通用的格式。
修改后-2
也可以使用这种格式。</description>
    </item>
    
    <item>
      <title>String process</title>
      <link>/post/2018/02/04/stringprocess/</link>
      <pubDate>Sun, 04 Feb 2018 00:00:00 +0000</pubDate>
      
      <guid>/post/2018/02/04/stringprocess/</guid>
      <description>grep(pattern, x, ignore.case = FALSE, perl = FALSE, value = FALSE, fixed = FALSE, useBytes = FALSE, invert = FALSE) grepl(pattern, x, ignore.case = FALSE, perl = FALSE, fixed = FALSE, useBytes = FALSE) sub(pattern, replacement, x, ignore.case = FALSE, perl = FALSE, fixed = FALSE, useBytes = FALSE) gsub(pattern, replacement, x, ignore.case = FALSE, perl = FALSE, fixed = FALSE, useBytes = FALSE) regexpr(pattern, text, ignore.case = FALSE, perl = FALSE, fixed = FALSE, useBytes = FALSE) gregexpr(pattern, text, ignore.</description>
    </item>
    
    <item>
      <title>About Me</title>
      <link>/about/</link>
      <pubDate>Sat, 27 Jan 2018 22:32:00 +0000</pubDate>
      
      <guid>/about/</guid>
      <description>This is a website which talks about Drug Quality Management Technology whcih may includes satistical analysis, regulatory requirements, Best Practices for the drug manufacturing and quality management.
This is Jonie that expect to communicate with you. You can subscribe our Official Accounts with the passport name DataSciences.</description>
    </item>
    
    <item>
      <title>Another Note on A blogdown Tutorial</title>
      <link>/note/2017/06/14/another-note/</link>
      <pubDate>Wed, 14 Jun 2017 00:00:00 +0000</pubDate>
      
      <guid>/note/2017/06/14/another-note/</guid>
      <description>I just discovered an awesome tutorial on blogdown written by Alison. I have to admit this is the best blogdown tutorial I have seen so far.</description>
    </item>
    
    <item>
      <title>A Quick Note on Two Beautiful Websites</title>
      <link>/note/2017/06/13/a-quick-note/</link>
      <pubDate>Tue, 13 Jun 2017 00:00:00 +0000</pubDate>
      
      <guid>/note/2017/06/13/a-quick-note/</guid>
      <description>To me, the two most impressive websites based on blogdown are:
 Rob J Hyndman&amp;rsquo;s personal website. Live Free or Dichotomize by Lucy and Nick et al.  I&amp;rsquo;m sure there will be more.</description>
    </item>
    
  </channel>
</rss>