Advertisement
hiddenGem

Real-life Applications Final Exam

Jun 29th, 2020
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 1.99 KB | None | 0 0
  1. %% Real-life Applications Final Exam
  2. % Final Exam Project
  3. % A collection of final exam questions
  4. clc
  5.  
  6. %% This section will plot Michaelis-Menten curves
  7. % of V-observed vs. the concentration of Remdesivir-TP for the
  8. % velocity of the incorporation of remdesivir by viral and
  9. % human RNA polymerase
  10.  
  11. % Virus Values
  12. VmaxVirus = 0.75;
  13. KmVirus = 5.7;
  14. C = logspace(-2, 4);
  15. VobsVirus = (VmaxVirus.*C)./(C+KmVirus);
  16.  
  17. % Human Values
  18. VmaxHuman = 0.81;
  19. KmHuman = 21;
  20. VobsHuman = (VmaxHuman.*C)./(C+KmHuman);
  21.  
  22. % Graphing the functions
  23. hold on
  24. semilogx(VobsVirus)
  25. semilogx(VobsHuman)
  26. title('V Observed vs. Concentration of Remdesivir-TP for Human and Virus')
  27. legend('Virus', 'Human', 'Location', 'best')
  28. xlabel('Concentration of Remdesivir-TP(uM)')
  29. ylabel('V Observed')
  30.  
  31. %% Continuing from the last section
  32. % Determines specific values from concentrations
  33. clc
  34. V= [0.1 10 100];
  35. VobsV = (VmaxVirus.*V)./(V+KmVirus)
  36. VobsH = (VmaxHuman.*V)./(V+KmHuman)
  37. TW = VobsV - VobsH
  38.  
  39. %% This section uses a two-tailed fishers exact test to determine whether or not
  40. % a survival outcome is statistically significant on contingency tables
  41. clc, clear
  42.  
  43. s1 = table([84;16], [80;20],'VariableNames',{'Experimental','Placebo'},'RowNames',{'Lived','Died'})
  44. s2 = table([840;160], [800;200],'VariableNames',{'Experimental','Placebo'},'RowNames',{'Lived','Died'})
  45. [h1, p1, stats1] = fishertest(s1)
  46. [h2, p2, stats2] = fishertest(s2)
  47.  
  48. %% Continued from the last section
  49. % Runs a simulation to help determine when a cohort size will become significant
  50. % Will run a fishers exact test and graph the value
  51. clc, clear
  52.  
  53. CohortSize = 20:10:2000;
  54. CSlength = length(CohortSize);
  55. P = [];
  56.  
  57. for i = 1:CSlength
  58.     C = CohortSize(i);
  59.     b = C/2 * 0.80;
  60.     d = C/2 * 0.20;
  61.     c = d - d * 0.20;
  62.     a = C/2 - c;
  63.     s = [a b
  64.          c d];
  65.     s = round(s);
  66.     [h, p, stats] = fishertest(s);
  67.     P(i) = p;
  68. end
  69. semilogy(P)
  70. %plot(CohortSize, P)
  71. xlabel('Cohort Size')
  72. ylabel('p-values')
  73. title('p-values vs. Cohort Size')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement