diff --git a/Latex/Paper/Main.tex b/Latex/Paper/Main.tex index 8fec9a9..e2da6b2 100644 --- a/Latex/Paper/Main.tex +++ b/Latex/Paper/Main.tex @@ -52,10 +52,10 @@ \subfile{sections/10_CausalStory} \subfile{sections/02_data} -%--------------------------------------------------------------- -\section{Causal Identification}\label{SEC:CausalIdentification} -%--------------------------------------------------------------- -\subfile{sections/03_CausalIdentification} +% %--------------------------------------------------------------- +% \section{Causal Identification}\label{SEC:CausalIdentification} +% %--------------------------------------------------------------- +% \subfile{sections/03_CausalIdentification} %--------------------------------------------------------------- \section{Econometric Model}\label{SEC:EconometricModel} diff --git a/Latex/Paper/sections/03_CausalIdentification.tex b/Latex/Paper/sections/03_CausalIdentification.tex index 7d8f6c8..3d8d9a2 100644 --- a/Latex/Paper/sections/03_CausalIdentification.tex +++ b/Latex/Paper/sections/03_CausalIdentification.tex @@ -62,7 +62,7 @@ investment directly, causing a trial to terminate early if the return is not high enough. \begin{figure}[H] %use [H] to fix the figure here. - \includegraphics[width=\textwidth]{../assets/img/dagitty-model.jpg} + \scalebox{0.6}{\tikzfig{../assets/tikzit/CausalGraph2}} \caption{Causal Model} \label{Fig:CausalModel} \end{figure} diff --git a/Latex/Paper/sections/04_EconometricModel.tex b/Latex/Paper/sections/04_EconometricModel.tex index bafa522..b8f2d6c 100644 --- a/Latex/Paper/sections/04_EconometricModel.tex +++ b/Latex/Paper/sections/04_EconometricModel.tex @@ -47,8 +47,8 @@ The betas are distributed \end{align} With hyperparameters \begin{align} - \mu_k \sim \text{Normal}(0,1) \\ - \sigma_k \sim \text{Gamma}(2,1) + \mu_k \sim \text{Normal}(0,0.05) \\ + \sigma_k \sim \text{Gamma}(4,20) \end{align} diff --git a/Latex/Paper/sections/06_Results.tex b/Latex/Paper/sections/06_Results.tex index ce79999..999e056 100644 --- a/Latex/Paper/sections/06_Results.tex +++ b/Latex/Paper/sections/06_Results.tex @@ -19,97 +19,101 @@ written or requires reparameterization. %TODO: and info about how I learned about these diagnostics -\subsubsection{Diagnostics} -%Examine trank plots -To identify which parameters were problematic, I first looked at trace rank -histograms. -Under idea circumstances, each line (representing a chain) should exchange -places with the other lines frequently. -In both \cref{fig:mu_trank} and \cref{fig:sigma_trank}, most parameters seem -to mix well but there are a couple of exceptions. -This warrants further investigation. +% \subsubsection{Diagnostics} +% %Examine trank plots +% To identify which parameters were problematic, I first looked at trace rank +% histograms. +% Under idea circumstances, each line (representing a chain) should exchange +% places with the other lines frequently. +% In both \cref{fig:mu_trank} and \cref{fig:sigma_trank}, most parameters seem +% to mix well but there are a couple of exceptions. +% This warrants further investigation. +% +% \begin{figure}[H] +% \includegraphics[width=\textwidth]{../assets/img/mu_trank.png} +% \caption{Trace Rank Histogram: Mu values} +% \label{fig:mu_trank} +% \end{figure} +% +% \begin{figure}[H] +% \includegraphics[width=\textwidth]{../assets/img/sigma_trank.png} +% \caption{Trace Rank Histogram: Sigma values} +% \label{fig:sigma_trank} +% \end{figure} +% +% %Take a look at batman and points for mu +% In the case of the Mu values, a parallel coordinates plot +% doesn't seem to indicate any parameters as likely candidates +% for causing the issues with divergent transitions. +% \begin{figure}[H] +% \includegraphics[width=\textwidth]{../assets/img/mu_batman.png} +% \caption{Parallel Coordinate Plot: Mu values} +% \label{fig:mu_batman} +% \end{figure} +% Note that at each parameter, there is some level of dispersion between +% values that diverged. +% +% On the other hand, in the parallel coordinates plot for sigma values, +% it appears that most divergent transitions occur with values of +% sigma[1], sigma[3], sigma[6], and sigma[7] close to zero. +% \begin{figure}[H] +% \includegraphics[width=\textwidth]{../assets/img/sigma_batman.png} +% \caption{Parallel Coordinate Plot: Sigma values} +% \label{fig:sigma_batman} +% \end{figure} +% Overall this suggests that there is an issue with the specification +% of the covariance structures of the hyperparameters. +% +% Additional evidence that the covariance structure is incorrect comes from +% plotting pairs of parameter values and examining the chains with divergent +% transitions. +% +% \begin{figure}[H] +% \includegraphics[width=\textwidth]{../assets/img/sigma_pairs_5-9.png} +% \caption{Parameter Pairs plots: Sigma[5] through Sigma[9]} +% \label{fig:sigma_pairs_5-9.png} +% \end{figure} +% From this we can see that divergent pairs are highly correlated with the cases +% where sigma[6] or sigma[7] are equal to zero. +% This has an impact on the shape of both of those estimated parameters, causing +% both to be bimodal. -\begin{figure}[H] - \includegraphics[width=\textwidth]{../assets/img/mu_trank.png} - \caption{Trace Rank Histogram: Mu values} - \label{fig:mu_trank} -\end{figure} -\begin{figure}[H] - \includegraphics[width=\textwidth]{../assets/img/sigma_trank.png} - \caption{Trace Rank Histogram: Sigma values} - \label{fig:sigma_trank} -\end{figure} +\subsection{Interpretation} -%Take a look at batman and points for mu -In the case of the Mu values, a parallel coordinates plot -doesn't seem to indicate any parameters as likely candidates -for causing the issues with divergent transitions. -\begin{figure}[H] - \includegraphics[width=\textwidth]{../assets/img/mu_batman.png} - \caption{Parallel Coordinate Plot: Mu values} - \label{fig:mu_batman} -\end{figure} -Note that at each parameter, there is some level of dispersion between -values that diverged. +The key results so far are related to the distribution of differences in $p$. + +In figure \ref{fig:pred_dist_dif_delay} we see that there while most trials do not see any increased risk +from a delay in closing enrollment, there is a small group that does experience this. -On the other hand, in the parallel coordinates plot for sigma values, -it appears that most divergent transitions occur with values of -sigma[1], sigma[3], sigma[6], and sigma[7] close to zero. \begin{figure}[H] - \includegraphics[width=\textwidth]{../assets/img/sigma_batman.png} - \caption{Parallel Coordinate Plot: Sigma values} - \label{fig:sigma_batman} + \includegraphics[width=\textwidth]{../assets/img/current/pred_dist_diff-delay} + \caption{} + \label{fig:pred_dist_diff_delay} \end{figure} -Overall this suggests that there is an issue with the specification -of the covariance structures of the hyperparameters. - -Additional evidence that the covariance structure is incorrect comes from -plotting pairs of parameter values and examining the chains with divergent -transitions. +Figure \ref{fig:pred_dist_dif_delay2} shows how this varies across disease categories \begin{figure}[H] - \includegraphics[width=\textwidth]{../assets/img/sigma_pairs_5-9.png} - \caption{Parameter Pairs plots: Sigma[5] through Sigma[9]} - \label{fig:sigma_pairs_5-9.png} + \includegraphics[width=\textwidth]{../assets/img/current/pred_dist_diff-delay-group} + \caption{} + \label{fig:pred_dist_dif_delay2} \end{figure} -From this we can see that divergent pairs are highly correlated with the cases -where sigma[6] or sigma[7] are equal to zero. -This has an impact on the shape of both of those estimated parameters, causing -both to be bimodal. - - -\subsection{Interpretation} - -Ignoring the diagnosed issues with the model, we do see some interesting -preliminary results. - -%in mu, mu[5] shifted strongly -In \cref{fig:mu_posterior} we see that mu[5], the parameter corresponding -to enrollment appears to be strongly negative. -This is consistent with the idea that enrollment close to planned enrollment -decreases the probability of terminating the trial. -In \cref{fig:sigma_posterior}, sigma[2] (corresponding to the number of brands -selling the drug of interest) has a large variance covers some relatively -high values. -This suggests that the impact of how frequently the drug is sold varies greatly -across different ICD-10 categories of disease. +We can also examine the direct effect from adding a single generic competitior drug. \begin{figure}[H] - \includegraphics[width=\textwidth]{../assets/img/mu_posterior.png} - \caption{Posterior Parameter Estimates: Mu} - \label{fig:mu_posterior} + \includegraphics[width=\textwidth]{../assets/img/current/pred_dist_diff-generic} + \caption{} + \label{fig:pred_dist_diff_generic} \end{figure} -% Sigma[2] suggests there is a high variance in the impact that the number of drugs on the market has. +Figure \ref{fig:pred_dist_dif_generic2} shows how this varies across disease categories \begin{figure}[H] - \includegraphics[width=\textwidth]{../assets/img/sigma_posterior.png} - \caption{Posterior Hyperparameter Estimates: Sigma} - \label{fig:sigma_posterior} + \includegraphics[width=\textwidth]{../assets/img/current/pred_dist_diff-generic-group} + \caption{} + \label{fig:pred_dist_dif_generic2} \end{figure} -Due to the deficiencies in the data and model, this is the limit of the -analysis I will perform at this time. + \end{document} diff --git a/Latex/Paper/sections/10_CausalStory.tex b/Latex/Paper/sections/10_CausalStory.tex index 7d8f6c8..3d8d9a2 100644 --- a/Latex/Paper/sections/10_CausalStory.tex +++ b/Latex/Paper/sections/10_CausalStory.tex @@ -62,7 +62,7 @@ investment directly, causing a trial to terminate early if the return is not high enough. \begin{figure}[H] %use [H] to fix the figure here. - \includegraphics[width=\textwidth]{../assets/img/dagitty-model.jpg} + \scalebox{0.6}{\tikzfig{../assets/tikzit/CausalGraph2}} \caption{Causal Model} \label{Fig:CausalModel} \end{figure} diff --git a/Latex/assets/img/current/pred_dist_diff-delay-group.png b/Latex/assets/img/current/pred_dist_diff-delay-group.png new file mode 100644 index 0000000..d28db86 Binary files /dev/null and b/Latex/assets/img/current/pred_dist_diff-delay-group.png differ diff --git a/Latex/assets/img/current/pred_dist_diff-delay.png b/Latex/assets/img/current/pred_dist_diff-delay.png new file mode 100644 index 0000000..4ae871b Binary files /dev/null and b/Latex/assets/img/current/pred_dist_diff-delay.png differ diff --git a/Latex/assets/img/current/pred_dist_diff-generic-group.png b/Latex/assets/img/current/pred_dist_diff-generic-group.png new file mode 100644 index 0000000..f7afff1 Binary files /dev/null and b/Latex/assets/img/current/pred_dist_diff-generic-group.png differ diff --git a/Latex/assets/img/current/pred_dist_diff-generic.png b/Latex/assets/img/current/pred_dist_diff-generic.png new file mode 100644 index 0000000..c85806a Binary files /dev/null and b/Latex/assets/img/current/pred_dist_diff-generic.png differ diff --git a/Latex/assets/tikzit/CausalGraph2.tikz b/Latex/assets/tikzit/CausalGraph2.tikz new file mode 100644 index 0000000..f5cba1a --- /dev/null +++ b/Latex/assets/tikzit/CausalGraph2.tikz @@ -0,0 +1,37 @@ +\begin{tikzpicture} + \begin{pgfonlayer}{nodelayer} + \node [style=Red Box] (0) at (4, -1.5) {Will Terminate?}; + \node [style=Red Box] (1) at (-4.25, -1.5) {Market Measures}; + \node [style=Red Box] (5) at (-0.25, 2) {Enrollment Status}; + \node [style=emptyBox] (9) at (12.25, 6.25) {Fundamental Efficacy/Safety}; + \node [style=emptyBox] (10) at (-0.25, 8) {Previously Observed Efficacy/Safety}; + \node [style=emptyBox] (12) at (14, 0.25) {Currently Observed Efficacy/Safety}; + \node [style=Gray Box] (18) at (-6.5, 1.5) {Population}; + \node [style=Gray Box] (20) at (-0.25, 5) {Decision to procced with Phase III}; + \node [style=Gray Box] (21) at (0, -3.5) {Condition}; + \node [style=Gray Box] (22) at (7.25, 2.75) {Elapsed Duration}; + \end{pgfonlayer} + \begin{pgfonlayer}{edgelayer} + \draw [style=RightArrow] (18) to (5); + \draw [style=RightArrow] (18) to (1); + \draw [style=RightArrow] (9) to (10); + \draw [style=RightArrow] (10) to (20); + \draw [style=RightArrow] (9) to (12); + \draw [style=RightArrow] (12) to (0); + \draw [style=Light Arrow] (21) to (1); + \draw [style=Light Arrow] (21) to (0); + \draw [style=Light Arrow, in=-120, out=165, looseness=2.00] (21) to (18); + \draw [style=Light Arrow, in=180, out=180, looseness=2.75] (21) to (20); + \draw [style=Light Arrow, bend right=60, looseness=1.75] (21) to (9); + \draw [style=Light Arrow] (21) to (5); + \draw [style=RightArrow, in=-180, out=165, looseness=2.00] (1) to (20); + \draw [style=RightArrow] (20) to (5); + \draw [style=RightArrow] (22) to (0); + \draw [style=RightArrow, bend left] (20) to (0); + \draw [style=PurpleArrow] (1) to (0); + \draw [style=PurpleArrow] (1) to (5); + \draw [style=PurpleArrow] (5) to (0); + \draw [style=lightredarrow] (22) to (5); + \draw [style=lightredarrow] (5) to (22); + \end{pgfonlayer} +\end{tikzpicture}