Line 1: | Line 1: | ||
− | |||
<html><head> | <html><head> | ||
− | <meta charset="utf-8"><link rel="shortcut icon" href="/wiki/T--NCKU_Tainan--favicon. | + | <meta charset="utf-8"><link rel="shortcut icon" href="/wiki/images/8/80/T--NCKU_Tainan--favicon.png" type="image/x-icon"><link rel="icon" type="image/png" href="/wiki/images/8/80/T--NCKU_Tainan--favicon.png"><link rel="icon" type="image/x-icon" href="/wiki/images/8/80/T--NCKU_Tainan--favicon.png"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta property="og:title" content="Project Modeling - iGEM NCKU"><meta property="og:site_name" content="Project Modeling - iGEM NCKU"><meta property="og:description" content=""><title>Project Modeling - iGEM NCKU</title><meta http-equiv="Content-Type" content="text/html" charset="utf-8"><meta property="og:image" content=""><meta property="og:image:type" content="image/png"><link rel="stylesheet" href="/Team:NCKU_Tainan/css/frame/T--NCKU_Tainan--bootstrap_min_css?ctype=text/css&action=raw"><link href="/Team:NCKU_Tainan/font/T--NCKU_Tainan--NotoSans_css?ctype=text/css&action=raw" rel="stylesheet" type="text/css"><link rel="stylesheet" href="/Team:NCKU_Tainan/font/T--NCKU_Tainan--font-awesome_min_css?ctype=text/css&action=raw"> <link rel="stylesheet" href=""> |
</head> | </head> | ||
<body> | <body> | ||
− | <style>@font-face { font-family: 'NotoSansCJKtc-Regular'; src: url("/wiki/ | + | <style>@font-face { font-family: 'NotoSansCJKtc-Regular'; src: url("/wiki/images/0/0b/T--NCKU_Tainan--NotoSansCJKtc-Regular.woff") format('woff');}</style><nav class="navbar navbar-default"><div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="/Team:NCKU_Tainan"> <h1>NCKU</h1><h4>Tainan</h4> </a> </div> <div id="navbar" class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li> <a class="dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expa="" nded="true" href="/Team:NCKU_Tainan/Project">Project</a><div class="nav-underline"></div> <ul class="dropdown-menu" aria-labelledby="dropdownMenu2"> <li><a href="">Overview</a></li> <li><a href="">Description</a></li> <li><a href="/Team:NCKU_Tainan/Results">Results</a></li> <li><a href="">Modeling</a></li> <li><a href="/Team:NCKU_Tainan/Parts">Parts</a></li> </ul> </li> <li> <a class="dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expa="" nded="true" href="">Device</a><div class="nav-underline"></div> <ul class="dropdown-menu" aria-labelledby="dropdownMenu2"> <li><a href="">Hardware</a></li> <li><a href="">Software</a></li> <li><a href="">Demonstrate</a></li> </ul> </li> <li> <a class="dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expa="" nded="true" href="">Judging</a><div class="nav-underline"></div> <ul class="dropdown-menu" aria-labelledby="dropdownMenu2"> <li><a href="/Team:NCKU_Tainan/Medal">Medal</a></li> <li><a href="/Team:NCKU_Tainan/Safety">Safety form</a></li> </ul> </li> <li> <a class="dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expa="" nded="true" href="/Team:NCKU_Tainan/Team">Team</a><div class="nav-underline"></div> <ul class="dropdown-menu" aria-labelledby="dropdownMenu2"> <li><a href="/Team:NCKU_Tainan/Team">Team</a></li> <li><a href="/Team:NCKU_Tainan/Attributions">Attributions</a></li> <li><a href="/Team:NCKU_Tainan/Acknowledgement">Acknowledgement</a></li> <li><a href="">Collaborations</a></li> </ul> </li> <li> <a href="/Team:NCKU_Tainan/Human_Practices">Human Pratice</a><div class="nav-underline"></div> </li> <li> <a href="">Notebook</a><div class="nav-underline"></div> </li> </ul> <ul class="nav navbar-nav navbar-right"> </ul> </div><!--/.nav-collapse --></div><!--/.container-fluid --></nav><div id="container-big"><div id="line-left"></div><div id="line-left2"></div><div id="line-right"></div><div id="photo-left"></div></div><!--/.container-big --> <div class="container-fluid" style="margin-top:100px"> |
− | + | <div class="head">Project</div> | |
− | + | ||
− | + | ||
− | <div class="head"> | + | |
<div class="content row"> | <div class="content row"> | ||
<div class="col-md-9"> | <div class="col-md-9"> | ||
− | + | <div class="head2">Modeling : Statistics Analysis</div> | |
− | + | <div class="title-line">Introduction</div> | |
− | + | <p>In medicine, the blood glucose exceeding 5mmole/L implies having diabetes, and it exceeding 120mmol/L implies being a severe patient. Finding the person whose glucose concentration is over 5mmol/L or 120mmol/L is our target. First, we prove that there has difference between 0.1mmol/L and 5mmol/L (120mmol/L) in the paired-difference T test part. And, we use the regression and prediction intervals to distinguish exceeding 120mmol/L and 5mmol/L from exceeding 0.1mmol/L. From the result, 5mmol/L can be distinguished from 0.1mmol/L after 101 minutes, and 120mmol/L can be distinguished from 0.1mmol/L after 88 minutes.</p> | |
− | + | <img src=""> | |
− | + | <img src=""> | |
− | + | <div class="title-line">Paired-difference T test</div> | |
− | + | <p>In medicine, the blood glucose exceeding 5mmole/L implies having diabetes, and it exceeding 120mmol/L implies being a severe patient. Hence, we use paired-difference test to analyze whether the difference of these two groups (0.1 vs 5mmol/L or 0.1 vs 120mmol/L) have statistical significance in this part.</p> | |
− | + | <br><br> | |
− | + | <p>Procedure</p> | |
− | + | <br> | |
− | + | <p>1. Guessing that there is difference over 90 minutes, we analyze the data of 0.1mmol/L and 5mmol/L at 90 minutes first.</p> | |
− | + | <p>(Data)</p> | |
− | + | <table> | |
− | + | <tbody><tr> | |
− | + | <td class="dial size1"><div class="right">Experiment</div><div class="left">Types</div></td> | |
− | + | <td class="size2">First</td> | |
− | + | <td class="size2">Second</td> | |
− | + | <td class="size3">...</td> | |
− | + | <td class="size2">Twelfth</td> | |
− | + | </tr> | |
− | + | <tr> | |
− | + | <td>0.1mmol/L</td> | |
− | + | <td>358</td> | |
− | + | <td>368</td> | |
− | + | <td>...</td> | |
− | + | <td>338</td> | |
− | + | </tr> | |
− | + | <tr> | |
− | + | <td>5mmol/L</td> | |
− | + | <td>369</td> | |
− | + | <td>386</td> | |
− | + | <td>...</td> | |
− | + | <td>385</td> | |
− | + | </tr> | |
− | + | </tbody></table> | |
− | + | <br> | |
− | + | <p>Because the experiments of 0.1mmol/L and 5mmol/L have correlation and they are small sample, we choose the paired-difference test to examine whether there is difference in two groups at 90 minutes.</p> | |
− | + | <br> | |
− | + | <p>Analysis:<br>(use one-tailed test)<br></p> | |
− | + | <p>\(H_0:\mu_0\le0\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ H_\alpha:\mu_0\ge0\)</p> | |
− | + | <p>Because the sample is small, we choose the t distribution to test.</p> | |
− | + | <table> | |
− | + | <tbody><tr> | |
− | + | <td class="size1">d(=5mmol/L-0.1mmol/L)</td> | |
− | + | <td class="size2">11</td> | |
− | + | <td class="size2">18</td> | |
− | + | <td class="size3">...</td> | |
− | + | <td class="size2">47</td> | |
− | + | </tr> | |
− | + | </tbody></table> | |
− | + | <p>\(n\) (Number of paired differences)=12<br>\(\bar{d}\) (Mean of the sample differences)= 26.16666667<br>\(s_d\) (Standard deviation of the sample differences) = \(\sqrt{\frac{\sum(d_i-\bar{d})^2}{n-1}}\) = 13.19664788</p> | |
− | + | <p>Test statistic t = \(\frac{\bar{d}-0}{s_d/\sqrt{n}}\) = 6.868713411 \(\gt t_{0.05,11}\) = 1.795885<br>P(t\(\gt\)6.868713411)= 1.995084e-05<br>Hence, We conclude that there is a difference between 0.1 and 5mmol/L.</p> | |
− | + | <p>2. Find the minimal time at which there is statistical significance by paired-difference test.(use R program & α=0.05)</p> | |
− | + | <p>(Data)</p> | |
− | + | <table> | |
− | + | <tbody><tr> | |
− | + | <td class="size1 dial"><div class="right">Types</div><div class="left">Time(min)</div></td> | |
− | + | <td class="size2">0.1mmol/L</td> | |
− | + | <td class="size3">...</td> | |
− | + | <td class="size2">0.1mmol/L</td> | |
− | + | <td class="size2">5mmol/L</td> | |
− | + | <td class="size3">...</td> | |
− | + | <td class="size2">5mmol/L</td> | |
− | + | </tr> | |
− | + | <tr> | |
− | + | <td>0</td> | |
− | + | <td>295</td> | |
− | + | <td>...</td> | |
− | + | <td>276</td> | |
− | + | <td>292</td> | |
− | + | <td>...</td> | |
− | + | <td>291</td> | |
− | + | </tr> | |
− | + | <tr> | |
− | + | <td>1</td> | |
− | + | <td>296</td> | |
− | + | <td>...</td> | |
− | + | <td>276</td> | |
− | + | <td>290</td> | |
− | + | <td>...</td> | |
− | + | <td>291</td> | |
− | + | </tr> | |
− | + | <tr> | |
− | + | <td>2</td> | |
− | + | <td>301</td> | |
− | + | <td>...</td> | |
− | + | <td>277</td> | |
− | + | <td>292</td> | |
− | + | <td>...</td> | |
− | + | <td>287</td> | |
− | + | </tr> | |
− | + | <tr> | |
− | + | <td>.<br>.<br>.</td> | |
− | + | <td>.<br>.<br>.</td> | |
− | + | <td>...</td> | |
− | + | <td>.<br>.<br>.</td> | |
− | + | <td>.<br>.<br>.</td> | |
− | + | <td>...</td> | |
− | + | <td>.<br>.<br>.</td> | |
− | + | </tr> | |
− | + | <tr> | |
− | + | <td>119</td> | |
− | + | <td>392</td> | |
− | + | <td>...</td> | |
− | + | <td>372</td> | |
− | + | <td>420</td> | |
− | + | <td>...</td> | |
− | + | <td>443</td> | |
− | + | </tr> | |
− | + | <tr> | |
− | + | <td>120</td> | |
− | + | <td>392</td> | |
− | + | <td>...</td> | |
− | + | <td>374</td> | |
− | + | <td>427</td> | |
− | + | <td>...</td> | |
− | + | <td>439</td> | |
− | + | </tr> | |
− | + | </tbody></table> | |
− | + | <br> | |
− | + | <p>By using R program<br>\(t_{0.05,11}\) = 1.795885</p> | |
− | + | <table> | |
− | + | <tbody><tr> | |
− | + | <td class="dial size1"><div class="right">statistic</div><div class="left">Time(min)</div></td> | |
− | + | <td class="size1"><p>T statistic (\(t_0\))</p></td> | |
− | + | </tr> | |
− | + | <tr> | |
− | + | <td>0</td> | |
− | + | <td>2.283227</td> | |
− | + | </tr> | |
− | + | <tr> | |
− | + | <td>1</td> | |
− | + | <td>1.992688</td> | |
− | + | </tr> | |
− | + | <tr> | |
− | + | <td>.<br>.<br>.</td> | |
− | + | <td>.<br>.<br>.</td> | |
− | + | </tr> | |
− | + | <tr> | |
− | + | <td>119</td> | |
− | + | <td>11.908155</td> | |
− | + | </tr> | |
− | + | <tr> | |
− | + | <td>120</td> | |
+ | <td>15.538544</td> | ||
+ | </tr> | ||
+ | </tbody></table> | ||
+ | <p>Hence, we can find \(t_0 \gt t_{0.05,11}\) at every time.</p> | ||
+ | <p class="code">#Code:<br>data0.1<-read.csv("C:/Users/Rick/Desktop/NCKUactivity/iGEM/819test/0.1urine.csv",header=T)<br>data5<-read.csv("C:/Users/Rick/Desktop/ NCKUactivity/iGEM/819test/5urine.csv",header=T)<br>difference<-cbind(data5[,2]-data0.1[,2],data5[,3]-data0.1[,3],data5[,4]-data0.1[,4],data5[,5]-data0.1[,5],data5[,6]-data0.1[,6],data5[,7]-data0.1[,7],data5[,8]-data0.1[,8],data5[,9]-data0.1[,9],data5[,10]-data0.1[,10],data5[,11]-data0.1[,11],data5[,12]-data0.1[,12],data5[,13]-data0.1[,13])<br>dbar<-difference%*% rep(1/12,12)<br>var<- ((difference -rep(dbar, 12))^2%*%rep(1,12))/11<br>sd<-var^0.5<br>t<-(dbar/sd)*(12^0.5)</p> | ||
+ | <p>3. Same with procedure 2, find the minimal time at which there is statistical significance by paired-difference test. (use R program, α=0.05, remove a outlier data)</p> | ||
+ | <p>By using R program<br>\(t_{0.05,10}\) = 1.812461</p> | ||
+ | <table> | ||
+ | <tbody><tr> | ||
+ | <td class="dial size1"><div class="right">statistic</div><div class="left">Time(min)</div></td> | ||
+ | <td class="size1"><p>T statistic (\(t_0\))</p></td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>0</td> | ||
+ | <td>4.720629</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>1</td> | ||
+ | <td>4.580426</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>.<br>.<br>.</td> | ||
+ | <td>.<br>.<br>.</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>119</td> | ||
+ | <td>12.428324</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>120</td> | ||
+ | <td>14.240245</td> | ||
+ | </tr> | ||
+ | </tbody></table> | ||
+ | <p>Hence, we can find \(t_0 \gt t_{0.05,10}\) at every time.</p> | ||
+ | <p>Conclusion:<br> We can say there are the difference groups (0.1 vs 5 mmol/L or 0.1 vs 120mmol/L) in part 1 with the data. And then, we need to find an accurate value which can distinguish between two groups.</p> | ||
+ | <p class="code">#Code:<br>data0.1<-read.csv("C:/Users/Rick/Desktop/ NCKUactivity/iGEM/819test/0.1urine.csv",header=T)<br>data120<-read.csv("C:/Users/Rick/Desktop/ NCKUactivity/iGEM/819test/120urine.csv",header=T)<br>difference<-cbind(data120[,2]-data0.1[,2],data120[,3]-data0.1[,3],data120[,4]-data0.1[,4],data120[,5]-data0.1[,5],data120[,6]-data0.1[,6],data120[,8]-data0.1[,8],data120[,9]-data0.1[,9],data120[,10]-data0.1[,10],data120[,11]-data0.1[,11],data120[,12]-data0.1[,12],data120[,13]-data0.1[,13])<br>dbar<-difference%*% rep(1/11,11)<br>var<- ((difference -rep(dbar, 11))^2%*%rep(1,11))/10<br>sd<-var^0.5<br>t<-(dbar/sd)*(11^0.5)</p> | ||
+ | <div class="title-line">Regression & Prediction interval</div> | ||
+ | <p> Our product uses the fluorescence intensity to obtain the concentration of blood glucose. Therefore, whether we could precisely distinguish exceeding 120mmol/L and 5mmol/L from exceeding 0.1mmol/L becomes the most important problem. We use the skill of the prediction interval in this part.</p> | ||
+ | <br> | ||
+ | <p>Procedure</p> | ||
+ | <p>1. Use the regression to find the model of 0.1, 5, 120mmole/L, and show the prediction interval plot.</p> | ||
+ | <p class="center">(0.1mmol/L)<img src=""></p> | ||
+ | <p>(summary)<img src=""></p> | ||
+ | <p>(residual plot)<img src=""></p> | ||
+ | <p>(Q-Q plot)<img src=""></p> | ||
+ | <p>This model conforms the assumption and R-square is equal to 0.9541, so we think the cubic polynomial regression model is suitable.</p> | ||
+ | <p>(prediction interval)<br>Formula: \(\bar{X}\pm t_{\frac{\alpha}{2},n-1}S\sqrt{1+\frac{1}{n}}\)<img src=""></p> | ||
+ | <p>And look the following, the procedure is same in the 5mmol/L and 120mmol/L.</p><p class="center">(5mmol/L)<img src=""><img src=""><img src=""><img src=""><img src="">(120mmol/L)<img src=""><img src=""><img src=""><img src=""><img src=""></p> | ||
+ | <p>2. According to the previous part, we can say that 0.1mmol/L and 5mmol/L are difference group by the statistical significance. In order to precisely distinguish these two groups, choose the time at which the 5mmo/L and 0.1mmo/L prediction interval started to diverge to be the recommended prediction time.<img src=""></p> | ||
+ | <p>By the above tables, we can see that 5mmol/L low prediction line exceeds 0.1mmol/L up prediction line when the time is more than 101 mins. Hence, it can be expected to have a higher accuracy to take the data after 101 mins.</p> | ||
+ | <br> | ||
+ | <p>(prediction interval of 0.1 &5 mmol/L)<img src=""></p> | ||
+ | <p>3. Same with procedure 2, choose the time at which the 120mmo/L and 0.1mmo/L prediction interval started to diverge to be the recommended prediction time.<img src=""></p> | ||
+ | <p>By the above tables, we can find that 120mmol/L low prediction line exceeds 0.1mmol/L up prediction line when the time is more than 88 mins. Hence, it can be expected to have a higher accuracy to take the data in 88 mins.</p> | ||
+ | <br> | ||
+ | <p>(prediction interval of 0.1 &120 mmol/L)<img src=""></p> | ||
+ | <h1 class="center">Appendix</h1> | ||
+ | <p class="code">Code:<br>#0.1 vs 5<br>#0.1 urine plot<br>data<- read.csv("C:/Users/Rick/Desktop/ NCKUactivity/iGEM/819test/0.1urine.csv",header=T)<br>x1<-rep(data[,1],12)<br>x2<-x1^2<br>x3<-x1^3<br>y1<-c(data[,2],data[,3],data[,4],data[,5],data[,6],data[,7], data[,8],data[,9],data[,10],data[,11],data[,12],data[,13])<br>model<-lm(y1~x1+x2+x3)<br>yhat0.1<-model$fit<br>plot(x1,y1,ylim=c(250,450),xlab= "time(mins) ",ylab= "Fluorescent", cex.lab=1.5)<br>#lines(data[,1], yhat0.1[1:121],lwd=3,col=2)<br>n=121*12<br>mse<-sum((y1-yhat0.1)^2)/(n-3) # calculate MS_Res(=σ^2)<br>X<-cbind(1,x1,x2,x3)<br>se<-sqrt(mse*(1+X[1,]%*%solve(t(X)%*%X)%*%X[1,]))<br>up0.1<-model$coefficients[1]+x1*model$coefficients[2]+x2*model$coefficients[3]+x3*model$coefficients[4]+qt(.975,df=n-2)*se<br>low0.1<-model$coefficients[1]+x1*model$coefficients[2]+x2*model$coefficients[3]+x3*model$coefficiens[4]+qt(.025,df=n-2)*se<br>lines(data[,1], up0.1[1:121], col=2,lwd=3)<br>lines(data[,1], low0.1[1:121],col=2,lwd=3)<br>#5 urine plot<br>data<- read.csv("C:/Users/Rick/Desktop/ NCKUactivity/iGEM/819test/5urine.csv",header=T)x1<-rep(data[,1],12)<br>x2<-x1^2<br>x3<-x1^3<br>y1<-c(data[,2],data[,3],data[,4],data[,5],data[,6],data[,7], data[,8],data[,9],data[,10],data[,11],data[,12],data[,13])<br>model<-lm(y1~x1+x2+x3)<br>yhat5<-model$fit<br>par(new=TRUE)<br>plot(x1,y1,ylim=c(250,450),xlab= "time(mins) ",ylab= "Fluorescent", cex.lab=1.5)<br>#lines(data[,1], yhat5[1:121],lwd=3,col=2)<br>n=121*12<br>mse<-sum((y1-yhat5)^2)/(n-3) # calculate MS_Res(=σ^2)<br>X<-cbind(1,x1,x2,x3)<br>se<-sqrt(mse*(1+X[1,]%*%solve(t(X)%*%X)%*%X[1,]))<br>up5<-model$coefficients[1]+x1*model$coefficients[2]+x2*model$coefficients[3]+x3*model$coefficients[4]+qt(.975,df=n-2)*se<br>low5<-model$coefficients[1]+x1*model$coefficients[2]+x2*model$coefficients[3]+x3*model$coefficients[4] +qt(.025,df=n-2)*se<br>lines(data[,1], up5[1:121], col=3,lwd=3)<br>lines(data[,1], low5[1:121], col=3,lwd=3)<br>title(main="0.1 vs 5mmol/L",cex.main=4)<br>Name<-c(expression(paste("0.1mmol/L")),expression(paste("5mmol/L")))<br>legend("topleft", Name, ncol = 1, cex = 1.5, col=c("red","green"),lwd = c(2,2), bg = 'gray90')<br>#0.1 vs 120<br>#0.1 urine plot<br>data<- read.csv("C:/Users/Rick/Desktop/NCKUactivity/iGEM/819test/0.1urine.csv",header=T)<br>x1<-rep(data[,1],12)<br>x2<-x1^2<br>x3<-x1^3<br>y1<-c(data[,2],data[,3],data[,4],data[,5],data[,6],data[,7], data[,8],data[,9],data[,10],data[,11],data[,12],data[,13])<br>model<-lm(y1~x1+x2+x3)<br>yhat0.1<-model$fit<br>plot(x1,y1,ylim=c(250,450),xlab= "time(mins) ",ylab= "Fluorescent", cex.lab=1.5)#lines(data[,1], yhat0.1[1:121],lwd=3,col=2)<br>n=121*12<br>mse<-sum((y1-yhat0.1)^2)/(n-3) # calculate MS_Res(=σ^2)<br>X<-cbind(1,x1,x2,x3)<br>se<-sqrt(mse*(1+X[1,]%*%solve(t(X)%*%X)%*%X[1,]))<br>up0.1<-model$coefficients[1]+x1*model$coefficients[2]+x2*model$coefficients[3]+x3*model$coefficients[4]+qt(.975,df=n-2)*se<br>low0.1<-model$coefficients[1]+x1*model$coefficients[2]+x2*model$coefficients[3]+x3*model$coefficiens[4]+qt(.025,df=n-2)*se<br>lines(data[,1], up0.1[1:121], col=2,lwd=3)<br>lines(data[,1], low0.1[1:121],col=2,lwd=3)<br>#120 urine plot<br>data<- read.csv("C:/Users/Rick/Desktop/ NCKUactivity/iGEM/819test/120urine.csv",header=T)<br>x1<-rep(data[,1],10)<br>x2<-x1^2<br>x3<-x1^3<br>y1<-c(data[,2],data[,3],data[,4],data[,5],data[,6],data[,9],data[,10],data[,11],data[,12],data[,13])model<-lm(y1~x1+x2+x3)<br>yhat120<-model$fit<br>par(new=TRUE)<br>plot(x1,y1,ylim=c(250,450),xlab= "time(mins) ",ylab= "Fluorescent", cex.lab=1.5)<br>#lines(data[,1], yhat120[1:121],lwd=3,col=2)<br>n=121*10mse<-sum((y1-yhat120)^2)/(n-3) # calculate MS_Res(=σ^2)<br>X<-cbind(1,x1,x2,x3)<br>se<-sqrt(mse*(1+X[1,]%*%solve(t(X)%*%X)%*%X[1,]))<br>up120<-model$coefficients[1]+x1*model$coefficients[2]+x2*model$coefficients[3]+x3*model$coefficients[4]+qt(.975,df=n-2)*se<br>low120<-model$coefficients[1]+x1*model$coefficients[2]+x2*model$coefficients[3]+x3*model$coefficiens[4]+qt(.025,df=n-2)*se<br>lines(data[,1], up120[1:121], col=4,lwd=3)<br>lines(data[,1], low120[1:121], col=4,lwd=3)<br>title(main="0.1 vs 120mmol/L",cex.main=4)<br>Name<-c(expression(paste("0.1mmol/L")),expression(paste("120mmol/L")))<br>legend("topleft", Name, ncol = 1, cex = 1.5, col=c("red","green"),lwd = c(2,2), bg = 'gray90')</p> | ||
</div> | </div> | ||
<div class="col-md-3"> | <div class="col-md-3"> | ||
− | + | <div class="block">Criteria:<br>EVERYTHING<br>is<br>AWESOME</div> | |
− | < | + | <div class="block">KEYPOINT:<br>EVERYTHING<br>is<br>AWESOME</div> |
− | + | ||
− | < | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
</div> | </div> | ||
</div> | </div> | ||
</div> <!-- /.container-fluid --> | </div> <!-- /.container-fluid --> | ||
− | <script src="/ | + | <script src="/Team:NCKU_Tainan/js/frame/T--NCKU_Tainan--jquery-1_12_0_min_js?ctype=text/javascript&action=raw"></script><script src="/Team:NCKU_Tainan/js/frame/T--NCKU_Tainan--bootstrap_min_js?ctype=text/javascript&action=raw"></script><script src="/Team:NCKU_Tainan/js/T--NCKU_Tainan--common_js?ctype=text/javascript&action=raw"></script> <script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> |
+ | |||
</body></html> | </body></html> |
Revision as of 05:31, 9 October 2016
In medicine, the blood glucose exceeding 5mmole/L implies having diabetes, and it exceeding 120mmol/L implies being a severe patient. Finding the person whose glucose concentration is over 5mmol/L or 120mmol/L is our target. First, we prove that there has difference between 0.1mmol/L and 5mmol/L (120mmol/L) in the paired-difference T test part. And, we use the regression and prediction intervals to distinguish exceeding 120mmol/L and 5mmol/L from exceeding 0.1mmol/L. From the result, 5mmol/L can be distinguished from 0.1mmol/L after 101 minutes, and 120mmol/L can be distinguished from 0.1mmol/L after 88 minutes.
In medicine, the blood glucose exceeding 5mmole/L implies having diabetes, and it exceeding 120mmol/L implies being a severe patient. Hence, we use paired-difference test to analyze whether the difference of these two groups (0.1 vs 5mmol/L or 0.1 vs 120mmol/L) have statistical significance in this part.
Procedure
1. Guessing that there is difference over 90 minutes, we analyze the data of 0.1mmol/L and 5mmol/L at 90 minutes first.
(Data)
Experiment Types |
First | Second | ... | Twelfth |
0.1mmol/L | 358 | 368 | ... | 338 |
5mmol/L | 369 | 386 | ... | 385 |
Because the experiments of 0.1mmol/L and 5mmol/L have correlation and they are small sample, we choose the paired-difference test to examine whether there is difference in two groups at 90 minutes.
Analysis:
(use one-tailed test)
\(H_0:\mu_0\le0\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ H_\alpha:\mu_0\ge0\)
Because the sample is small, we choose the t distribution to test.
d(=5mmol/L-0.1mmol/L) | 11 | 18 | ... | 47 |
\(n\) (Number of paired differences)=12
\(\bar{d}\) (Mean of the sample differences)= 26.16666667
\(s_d\) (Standard deviation of the sample differences) = \(\sqrt{\frac{\sum(d_i-\bar{d})^2}{n-1}}\) = 13.19664788
Test statistic t = \(\frac{\bar{d}-0}{s_d/\sqrt{n}}\) = 6.868713411 \(\gt t_{0.05,11}\) = 1.795885
P(t\(\gt\)6.868713411)= 1.995084e-05
Hence, We conclude that there is a difference between 0.1 and 5mmol/L.
2. Find the minimal time at which there is statistical significance by paired-difference test.(use R program & α=0.05)
(Data)
Types Time(min) |
0.1mmol/L | ... | 0.1mmol/L | 5mmol/L | ... | 5mmol/L |
0 | 295 | ... | 276 | 292 | ... | 291 |
1 | 296 | ... | 276 | 290 | ... | 291 |
2 | 301 | ... | 277 | 292 | ... | 287 |
. . . |
. . . |
... | . . . |
. . . |
... | . . . |
119 | 392 | ... | 372 | 420 | ... | 443 |
120 | 392 | ... | 374 | 427 | ... | 439 |
By using R program
\(t_{0.05,11}\) = 1.795885
statistic Time(min) |
T statistic (\(t_0\)) |
0 | 2.283227 |
1 | 1.992688 |
. . . |
. . . |
119 | 11.908155 |
120 | 15.538544 |
Hence, we can find \(t_0 \gt t_{0.05,11}\) at every time.
#Code:
data0.1<-read.csv("C:/Users/Rick/Desktop/NCKUactivity/iGEM/819test/0.1urine.csv",header=T)
data5<-read.csv("C:/Users/Rick/Desktop/ NCKUactivity/iGEM/819test/5urine.csv",header=T)
difference<-cbind(data5[,2]-data0.1[,2],data5[,3]-data0.1[,3],data5[,4]-data0.1[,4],data5[,5]-data0.1[,5],data5[,6]-data0.1[,6],data5[,7]-data0.1[,7],data5[,8]-data0.1[,8],data5[,9]-data0.1[,9],data5[,10]-data0.1[,10],data5[,11]-data0.1[,11],data5[,12]-data0.1[,12],data5[,13]-data0.1[,13])
dbar<-difference%*% rep(1/12,12)
var<- ((difference -rep(dbar, 12))^2%*%rep(1,12))/11
sd<-var^0.5
t<-(dbar/sd)*(12^0.5)
3. Same with procedure 2, find the minimal time at which there is statistical significance by paired-difference test. (use R program, α=0.05, remove a outlier data)
By using R program
\(t_{0.05,10}\) = 1.812461
statistic Time(min) |
T statistic (\(t_0\)) |
0 | 4.720629 |
1 | 4.580426 |
. . . |
. . . |
119 | 12.428324 |
120 | 14.240245 |
Hence, we can find \(t_0 \gt t_{0.05,10}\) at every time.
Conclusion:
We can say there are the difference groups (0.1 vs 5 mmol/L or 0.1 vs 120mmol/L) in part 1 with the data. And then, we need to find an accurate value which can distinguish between two groups.
#Code:
data0.1<-read.csv("C:/Users/Rick/Desktop/ NCKUactivity/iGEM/819test/0.1urine.csv",header=T)
data120<-read.csv("C:/Users/Rick/Desktop/ NCKUactivity/iGEM/819test/120urine.csv",header=T)
difference<-cbind(data120[,2]-data0.1[,2],data120[,3]-data0.1[,3],data120[,4]-data0.1[,4],data120[,5]-data0.1[,5],data120[,6]-data0.1[,6],data120[,8]-data0.1[,8],data120[,9]-data0.1[,9],data120[,10]-data0.1[,10],data120[,11]-data0.1[,11],data120[,12]-data0.1[,12],data120[,13]-data0.1[,13])
dbar<-difference%*% rep(1/11,11)
var<- ((difference -rep(dbar, 11))^2%*%rep(1,11))/10
sd<-var^0.5
t<-(dbar/sd)*(11^0.5)
Our product uses the fluorescence intensity to obtain the concentration of blood glucose. Therefore, whether we could precisely distinguish exceeding 120mmol/L and 5mmol/L from exceeding 0.1mmol/L becomes the most important problem. We use the skill of the prediction interval in this part.
Procedure
1. Use the regression to find the model of 0.1, 5, 120mmole/L, and show the prediction interval plot.
(0.1mmol/L)
(summary)
(residual plot)
(Q-Q plot)
This model conforms the assumption and R-square is equal to 0.9541, so we think the cubic polynomial regression model is suitable.
(prediction interval)
Formula: \(\bar{X}\pm t_{\frac{\alpha}{2},n-1}S\sqrt{1+\frac{1}{n}}\)
And look the following, the procedure is same in the 5mmol/L and 120mmol/L.
(5mmol/L)(120mmol/L)
2. According to the previous part, we can say that 0.1mmol/L and 5mmol/L are difference group by the statistical significance. In order to precisely distinguish these two groups, choose the time at which the 5mmo/L and 0.1mmo/L prediction interval started to diverge to be the recommended prediction time.
By the above tables, we can see that 5mmol/L low prediction line exceeds 0.1mmol/L up prediction line when the time is more than 101 mins. Hence, it can be expected to have a higher accuracy to take the data after 101 mins.
(prediction interval of 0.1 &5 mmol/L)
3. Same with procedure 2, choose the time at which the 120mmo/L and 0.1mmo/L prediction interval started to diverge to be the recommended prediction time.
By the above tables, we can find that 120mmol/L low prediction line exceeds 0.1mmol/L up prediction line when the time is more than 88 mins. Hence, it can be expected to have a higher accuracy to take the data in 88 mins.
(prediction interval of 0.1 &120 mmol/L)
Appendix
Code:
#0.1 vs 5
#0.1 urine plot
data<- read.csv("C:/Users/Rick/Desktop/ NCKUactivity/iGEM/819test/0.1urine.csv",header=T)
x1<-rep(data[,1],12)
x2<-x1^2
x3<-x1^3
y1<-c(data[,2],data[,3],data[,4],data[,5],data[,6],data[,7], data[,8],data[,9],data[,10],data[,11],data[,12],data[,13])
model<-lm(y1~x1+x2+x3)
yhat0.1<-model$fit
plot(x1,y1,ylim=c(250,450),xlab= "time(mins) ",ylab= "Fluorescent", cex.lab=1.5)
#lines(data[,1], yhat0.1[1:121],lwd=3,col=2)
n=121*12
mse<-sum((y1-yhat0.1)^2)/(n-3) # calculate MS_Res(=σ^2)
X<-cbind(1,x1,x2,x3)
se<-sqrt(mse*(1+X[1,]%*%solve(t(X)%*%X)%*%X[1,]))
up0.1<-model$coefficients[1]+x1*model$coefficients[2]+x2*model$coefficients[3]+x3*model$coefficients[4]+qt(.975,df=n-2)*se
low0.1<-model$coefficients[1]+x1*model$coefficients[2]+x2*model$coefficients[3]+x3*model$coefficiens[4]+qt(.025,df=n-2)*se
lines(data[,1], up0.1[1:121], col=2,lwd=3)
lines(data[,1], low0.1[1:121],col=2,lwd=3)
#5 urine plot
data<- read.csv("C:/Users/Rick/Desktop/ NCKUactivity/iGEM/819test/5urine.csv",header=T)x1<-rep(data[,1],12)
x2<-x1^2
x3<-x1^3
y1<-c(data[,2],data[,3],data[,4],data[,5],data[,6],data[,7], data[,8],data[,9],data[,10],data[,11],data[,12],data[,13])
model<-lm(y1~x1+x2+x3)
yhat5<-model$fit
par(new=TRUE)
plot(x1,y1,ylim=c(250,450),xlab= "time(mins) ",ylab= "Fluorescent", cex.lab=1.5)
#lines(data[,1], yhat5[1:121],lwd=3,col=2)
n=121*12
mse<-sum((y1-yhat5)^2)/(n-3) # calculate MS_Res(=σ^2)
X<-cbind(1,x1,x2,x3)
se<-sqrt(mse*(1+X[1,]%*%solve(t(X)%*%X)%*%X[1,]))
up5<-model$coefficients[1]+x1*model$coefficients[2]+x2*model$coefficients[3]+x3*model$coefficients[4]+qt(.975,df=n-2)*se
low5<-model$coefficients[1]+x1*model$coefficients[2]+x2*model$coefficients[3]+x3*model$coefficients[4] +qt(.025,df=n-2)*se
lines(data[,1], up5[1:121], col=3,lwd=3)
lines(data[,1], low5[1:121], col=3,lwd=3)
title(main="0.1 vs 5mmol/L",cex.main=4)
Name<-c(expression(paste("0.1mmol/L")),expression(paste("5mmol/L")))
legend("topleft", Name, ncol = 1, cex = 1.5, col=c("red","green"),lwd = c(2,2), bg = 'gray90')
#0.1 vs 120
#0.1 urine plot
data<- read.csv("C:/Users/Rick/Desktop/NCKUactivity/iGEM/819test/0.1urine.csv",header=T)
x1<-rep(data[,1],12)
x2<-x1^2
x3<-x1^3
y1<-c(data[,2],data[,3],data[,4],data[,5],data[,6],data[,7], data[,8],data[,9],data[,10],data[,11],data[,12],data[,13])
model<-lm(y1~x1+x2+x3)
yhat0.1<-model$fit
plot(x1,y1,ylim=c(250,450),xlab= "time(mins) ",ylab= "Fluorescent", cex.lab=1.5)#lines(data[,1], yhat0.1[1:121],lwd=3,col=2)
n=121*12
mse<-sum((y1-yhat0.1)^2)/(n-3) # calculate MS_Res(=σ^2)
X<-cbind(1,x1,x2,x3)
se<-sqrt(mse*(1+X[1,]%*%solve(t(X)%*%X)%*%X[1,]))
up0.1<-model$coefficients[1]+x1*model$coefficients[2]+x2*model$coefficients[3]+x3*model$coefficients[4]+qt(.975,df=n-2)*se
low0.1<-model$coefficients[1]+x1*model$coefficients[2]+x2*model$coefficients[3]+x3*model$coefficiens[4]+qt(.025,df=n-2)*se
lines(data[,1], up0.1[1:121], col=2,lwd=3)
lines(data[,1], low0.1[1:121],col=2,lwd=3)
#120 urine plot
data<- read.csv("C:/Users/Rick/Desktop/ NCKUactivity/iGEM/819test/120urine.csv",header=T)
x1<-rep(data[,1],10)
x2<-x1^2
x3<-x1^3
y1<-c(data[,2],data[,3],data[,4],data[,5],data[,6],data[,9],data[,10],data[,11],data[,12],data[,13])model<-lm(y1~x1+x2+x3)
yhat120<-model$fit
par(new=TRUE)
plot(x1,y1,ylim=c(250,450),xlab= "time(mins) ",ylab= "Fluorescent", cex.lab=1.5)
#lines(data[,1], yhat120[1:121],lwd=3,col=2)
n=121*10mse<-sum((y1-yhat120)^2)/(n-3) # calculate MS_Res(=σ^2)
X<-cbind(1,x1,x2,x3)
se<-sqrt(mse*(1+X[1,]%*%solve(t(X)%*%X)%*%X[1,]))
up120<-model$coefficients[1]+x1*model$coefficients[2]+x2*model$coefficients[3]+x3*model$coefficients[4]+qt(.975,df=n-2)*se
low120<-model$coefficients[1]+x1*model$coefficients[2]+x2*model$coefficients[3]+x3*model$coefficiens[4]+qt(.025,df=n-2)*se
lines(data[,1], up120[1:121], col=4,lwd=3)
lines(data[,1], low120[1:121], col=4,lwd=3)
title(main="0.1 vs 120mmol/L",cex.main=4)
Name<-c(expression(paste("0.1mmol/L")),expression(paste("120mmol/L")))
legend("topleft", Name, ncol = 1, cex = 1.5, col=c("red","green"),lwd = c(2,2), bg = 'gray90')
EVERYTHING
is
AWESOME
EVERYTHING
is
AWESOME