Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % Again Part of my 201 Class
- % removed identifying features
- % Similar to Final Exam Applications paste
- %% Question 1b
- clc, clear, clf
- % Virus Values
- VmaxVirus = 0.75; % Vmax for Virus
- KmVirus = 5.7; % Km for Virus
- C = logspace(-2, 4); % Creating equally spaced log vector from 10^-2 to 10^4
- VobsVirus = (VmaxVirus.*C)./(C+KmVirus); % Vobs function for Virus in terms of Vmax, Km, and variable
- % Human Values
- VmaxHuman = 0.81; % Vmax for Human
- KmHuman = 21; % Km for Human
- VobsHuman = (VmaxHuman.*C)./(C+KmHuman); % Creating Vobs for Human in terms of Vmax, KM, and variable
- % Graphing the functions
- hold on % Hold on so I can plot two functions on one figure
- semilogx(VobsVirus) % Plotting Virus function on log x-axis
- semilogx(VobsHuman) % Plotting Human function on log x-axis
- title('V Observed vs. Concentration of Remdesivir-TP for Human and Virus') % Title for figure
- legend('Virus', 'Human', 'Location', 'best') % Creating legend to differentiate between functions in the best location
- xlabel('Concentration of Remdesivir-TP(uM)') % Horizontal label
- ylabel('V Observed') % Vertical label
- hold off % Removes hold on graph
- %% Question 1c
- V = [0.01 0.1 1 10] % [uM] Creating a concentration vector
- VobsV = (VmaxVirus.*V)./(V+KmVirus) % Creating Vobs function for Virus with set concentrations
- VobsH = (VmaxHuman.*V)./(V+KmHuman) % Creating Vobs function for Human with set concentrations
- TW = VobsV - VobsH % Therapeutic window
- %% Question 2a
- clc, clear, clf
- s1 = table([84;16],[80;20],'VariableNames',{'Experimental','Placebo'},'RowNames',{'Lived', 'Died'}) % Creating table for scenario 1
- s2 = table([840;160],[800;200],'VariableNames',{'Experimental','Placebo'},'RowNames',{'Lived', 'Died'}) % Creating table for scenario 2
- [h1, p1, stats1] = fishertest(s1) % Performing fisher's exact test on scenario 1 and getting values from results
- [h2, p2, stats2] = fishertest(s2) % Performing fisher's exact test on scenario 2 and getting values from results
- %% Question 2b
- clc, clear, clf
- CohortSize =[20 200 2000 20000]; % Creating cohort sizes vector
- for i = 1:length(CohortSize) % Beginning of the for loop that runs for length of the cohort vector
- C = CohortSize(i); % Reallocating the cohort size into a vector with a smaller name
- b = C/2 * 0.80; % Taking half of the cohort size and then saying 80% of this new group will live with placebo arm
- d = C/2 * 0.20; % Taking half of the cohort size and then saying 20% of this new group will die with placebo arm
- c = d*.80; % The number of patient who died with the experimental arm happens to be 80% in value of patients who died with the placebo arm
- a = C/2 - c; % Taking half of cohort size and subtracting the amount of the patients who died with experimental arm leaves the survivors with experimental arm
- s = [a b
- c d]; % Creating vector for the contingency table
- s = round(s); % round all the numbers within the vector
- [~, P(i), ~] = fishertest(s); % Perform the fisher's exact test and saving the p-values
- end % end for loop
- semilogy(CohortSize, P) % Plot p-values vs. cohort size with log y-axis
- xlabel('Cohort Size') % horizontal label
- ylabel('p-values') % vertical label
- title('p-values vs. Cohort Size') % Title for figure
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement