SHARE
TWEET

Untitled

a guest Jun 18th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. library(fitdistrplus)
  2. normal <- fitdist(testdata$Measure, "norm")
  3. lognormal <- fitdist(testdata$Measure, "lnorm")
  4. gofstat(lognormal)
  5. #AIC = -685.7581
  6. gofstat(normal)
  7. #AIC = -677.5334
  8.      
  9. plot(resid(fitLMM))
  10. plot(resid(fitGLMM))
  11. #The plots show that they are randomly distributed
  12.      
  13. fitLMM = lmer(Measure ~ VarResult + (1|Sample) + (1|TimeDays),data=testdata)
  14. fitGLMM = glmer(Measure ~VarResult + (1|Sample) + (1|TimeDays), data=testdata,family=Gamma(link = "log"))
  15. anova(fitLMM,fitGLMM)
  16. #Df     AIC     BIC logLik deviance Chisq Chi Df Pr(>Chisq)
  17. #fitGLMM  5 -823.55 -810.58 416.78  -833.55                        
  18. #fitLMM   6 -698.64 -683.07 355.32  -710.64     0      1          1
  19.      
  20. testdata = read.csv("Sample,Measure,TimeDays,VarResult
  21. 635,0.032378049,280,Neg
  22. 635,0.036529268,455,Neg
  23. 734,0.038922822,389,Pos
  24. 734,0.037950697,590,Neg
  25. 4,0.029629965,343,Neg
  26. 4,0.043117073,516,Pos
  27. 253,0.037353833,253,Neg
  28. 521,0.05366324,366,Neg
  29. 521,0.054729094,366,Neg
  30. 317,0.031040418,265.5,Neg
  31. 317,0.03427108,440,Neg
  32. 90,0.029745819,77,Pos
  33. 90,0.040464111,419,Pos
  34. 33,0.04897561,451,Neg
  35. 695,0.033675261,356.5,Neg
  36. 695,0.042414111,532,Neg
  37. 695,0.037702787,1460,Neg
  38. 559,0.027809582,98,Pos
  39. 56,0.035823868,259,Neg
  40. 811,0.044923519,84.5,Neg
  41. 811,0.040836063,287,Pos
  42. 196,0.037169686,282,Neg
  43. 196,0.053865157,4000,Neg
  44. 359,0.028349826,94.5,Neg
  45. 359,0.042155052,298,Neg
  46. 100,0.039143902,422,Neg
  47. 764,0.030491115,104.5,Pos
  48. 764,0.036705749,426,Pos
  49. 669,0.028559408,92,Pos
  50. 669,0.042163763,280,Pos
  51. 297,0.028658188,91.5,Pos
  52. 297,0.038996167,799,Pos
  53. 207,0.024137282,212.5,Pos
  54. 207,0.041345819,471,Pos
  55. 835,0.038783275,269.5,Neg
  56. 835,0.039457491,458,Neg
  57. 835,0.040020035,1825,Neg
  58. 472,0.025335366,98,Pos
  59. 472,0.058070209,289,Pos
  60. 274,0.030207143,206.5,Pos
  61. 274,0.04186777,403,Pos
  62. 274,0.025599652,206.5,Pos
  63. 274,0.043535366,403,Pos
  64. 22,0.027589547,80.5,Pos
  65. 22,0.039029965,255,Neg
  66. 22,0.04518223,2500,Neg
  67. 679,0.029500174,85.5,Pos
  68. 679,0.045858885,293,Neg
  69. 603,0.032273345,415.5,Pos
  70. 603,0.028848258,625,Pos
  71. 438,0.032180662,156,Pos
  72. 438,0.039858537,351,Neg
  73. 565,0.039438502,96.5,Pos
  74. 564,0.026607143,186,Pos
  75. 564,0.048023345,381,Neg
  76. 667,0.030010976,78,Pos
  77. 553,0.028255923,90.5,Neg
  78. 553,0.052350348,309,Neg
  79. 75,0.027937979,91.5,Neg
  80. 75,0.042420557,274,Neg
  81. 265,0.03024878,253,Pos
  82. 265,0.029622822,434,Neg
  83. 193,0.027783972,109,Pos
  84. 193,0.03874007,283,Pos
  85. 818,0.032143031,84.5,Pos
  86. 818,0.046759408,258,Neg
  87. 818,0.046601916,2500,Pos
  88. 427,0.027909233,101,Pos
  89. 427,0.039481882,290,Pos
  90. 767,0.039266202,84,Pos
  91. 767,0.041849652,265,Pos
  92. 84,0.029524913,87,Pos
  93. 84,0.03609878,283,Pos
  94. 84,0.039199129,1095,Neg
  95. 42,0.028929094,100,Pos
  96. 691,0.030785889,255,Neg
  97. 691,0.036512544,86.5,Pos
  98. 691,0.035471603,255,Neg
  99. 268,0.040618293,94,Neg
  100. 268,0.045518467,274,Neg
  101. 268,0.045215505,94,Neg
  102. 268,0.039156446,274,Neg
  103. 704,0.029968815,179,Pos
  104. 704,0.039189373,523,Pos
  105. 785,0.035352787,112,Pos
  106. 785,0.042238328,281,Pos
  107. 509,0.032170209,454,Pos
  108. 509,0.035958188,944,Pos
  109. 532,0.032875958,395.5,Pos
  110. 532,0.041398084,1206,Pos
  111. 182,0.063621951,340.5,Neg
  112. 155,0.039058014,396,Neg
  113. 231,0.049140592,125.5,Neg
  114. 797,0.028355226,329,Neg
  115. 797,0.043909582,811,Pos
  116. 73,0.040794425,483,Pos
  117. 73,0.041904007,713,Pos
  118. 530,0.031278049,103,Neg
  119. 530,0.035998258,278,Pos",header=TRUE)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top