Added all the updates for fixed run
I ran the analysis and got the following updated results.lognorm_sigma_prior
@ -0,0 +1,75 @@
|
||||
---
|
||||
title: "TrialCountExtraction"
|
||||
author: "Will"
|
||||
format: html
|
||||
editor: source
|
||||
---
|
||||
|
||||
|
||||
```{r}
|
||||
#| eval: false
|
||||
#| include: true
|
||||
|
||||
#Full set
|
||||
categories %>% unique() %>% sort() %>% length()
|
||||
|
||||
#Evaluation set
|
||||
cf_categories %>% unique() %>% sort() %>% length()
|
||||
|
||||
```
|
||||
|
||||
|
||||
```{r}
|
||||
# Pulled from df
|
||||
group_trials_by_category %>% group_by(category_id) %>% count()
|
||||
```
|
||||
|
||||
# Actual data from Evaluation and counterfactual
|
||||
```{r}
|
||||
# Original Evaluation
|
||||
# - Pulled from `categories` above when defined
|
||||
counterfact_delay$ll %>% unique() %>% sort() %>% length()
|
||||
|
||||
|
||||
# Counterfactual
|
||||
# - Pulled from `cf_categories` above when defined
|
||||
counterfact_delay$llx %>% unique() %>% sort() %>% length()
|
||||
```
|
||||
Those came from
|
||||
```{r}
|
||||
df$category_id %>% unique() %>% sort() %>% length()
|
||||
df_counterfact_base$category_id %>% unique() %>% sort() %>% length()
|
||||
```
|
||||
|
||||
The difference between those is that the counterfactual imposes the constraint
|
||||
that there must be a snapshot where it moves from "ANR" to "Rec", implying that
|
||||
it can't just terminate.
|
||||
|
||||
# Where do the other values drop
|
||||
|
||||
When we find the counterfactual, the table looses some of the categories etc.
|
||||
Here is the extracted data
|
||||
|
||||
```{r}
|
||||
data.frame(extract(generated_ib, pars="predicted_difference")$predicted_difference)
|
||||
```
|
||||
|
||||
```{r}
|
||||
pddf_ib <- data.frame(extract(generated_ib, pars="predicted_difference")$predicted_difference) |>
|
||||
pivot_longer(X1:X168) #CHANGE_NOTE: moved from X169 to X168
|
||||
|
||||
|
||||
pddf_ib["entry_idx"] <- as.numeric(gsub("\\D","",pddf_ib$name))
|
||||
pddf_ib["category"] <- sapply(pddf_ib$entry_idx, function(i) counterfact_delay$llx[i])
|
||||
pddf_ib["category_name"] <- sapply(
|
||||
pddf_ib$category,
|
||||
function(i) category_names[i]
|
||||
)
|
||||
```
|
||||
and yet it seems that we predict the difference for all 168 trials
|
||||
|
||||
It looks like there is an error where I apply category IDs. Because I'm pulling them from
|
||||
```{r}
|
||||
ground_truth <- df$category_id[1:168]
|
||||
```
|
||||
|
||||
|
Before Width: | Height: | Size: 357 KiB |
@ -1,34 +0,0 @@
|
||||
% latex table generated in R 4.4.2 by xtable 1.8-4 package
|
||||
% Mon Feb 3 23:56:27 2025
|
||||
\begin{table}[ht]
|
||||
\centering
|
||||
\begin{tabular}{ccccccccccc}
|
||||
\hline
|
||||
ICD-10 Category & sample size & mean & P(≥0) & 2.5\% & 5\% & 25\% & 50\% median & 75\% & 95\% & 97.5\% \\
|
||||
\hline
|
||||
01 Infections \& Parasites & 20.000 & 0.135 & 0.772 & -0.223 & -0.163 & 0.013 & 0.134 & 0.257 & 0.438 & 0.498 \\
|
||||
02 Neoplasms & 49.000 & 0.211 & 0.902 & -0.107 & -0.056 & 0.099 & 0.208 & 0.320 & 0.489 & 0.546 \\
|
||||
03 Blood \& Immune system & 1.000 & 0.061 & 0.624 & -0.333 & -0.267 & -0.071 & 0.061 & 0.194 & 0.388 & 0.454 \\
|
||||
04 Endocrine, Nutritional, and Metabolic & 10.000 & 0.177 & 0.820 & -0.201 & -0.137 & 0.045 & 0.173 & 0.304 & 0.505 & 0.573 \\
|
||||
05 Mental \& Behavioral & 8.000 & 0.142 & 0.767 & -0.239 & -0.175 & 0.010 & 0.140 & 0.270 & 0.469 & 0.537 \\
|
||||
06 Nervous System & 8.000 & 0.009 & 0.524 & -0.383 & -0.315 & -0.120 & 0.011 & 0.140 & 0.327 & 0.389 \\
|
||||
07 Eye and Adnexa & 11.000 & 0.061 & 0.624 & -0.333 & -0.265 & -0.069 & 0.062 & 0.192 & 0.386 & 0.452 \\
|
||||
08 Ear and Mastoid & 0.000 & 0.063 & 0.625 & -0.332 & -0.263 & -0.069 & 0.064 & 0.196 & 0.393 & 0.457 \\
|
||||
09 Circulatory & 3.000 & 0.037 & 0.577 & -0.362 & -0.293 & -0.094 & 0.038 & 0.170 & 0.363 & 0.426 \\
|
||||
10 Respiratory & 7.000 & 0.061 & 0.622 & -0.335 & -0.269 & -0.072 & 0.061 & 0.195 & 0.391 & 0.458 \\
|
||||
11 Digestive & 12.000 & 0.060 & 0.621 & -0.339 & -0.270 & -0.071 & 0.059 & 0.192 & 0.388 & 0.454 \\
|
||||
12 Skin \& Subcutaneaous tissue & 9.000 & 0.104 & 0.704 & -0.283 & -0.220 & -0.027 & 0.103 & 0.234 & 0.429 & 0.494 \\
|
||||
13 Musculoskeletal & 17.000 & 0.159 & 0.794 & -0.218 & -0.156 & 0.027 & 0.156 & 0.286 & 0.482 & 0.550 \\
|
||||
14 Genitourinary & 2.000 & 0.063 & 0.627 & -0.337 & -0.270 & -0.070 & 0.065 & 0.195 & 0.389 & 0.456 \\
|
||||
15 Pregancy, Childbirth, \& Puerperium & 0.000 & 0.061 & 0.622 & -0.336 & -0.270 & -0.071 & 0.061 & 0.194 & 0.392 & 0.458 \\
|
||||
16 Perinatal Period & 0.000 & 0.062 & 0.626 & -0.338 & -0.270 & -0.068 & 0.062 & 0.194 & 0.390 & 0.457 \\
|
||||
17 Congential & 3.000 & 0.063 & 0.628 & -0.332 & -0.264 & -0.068 & 0.063 & 0.195 & 0.391 & 0.456 \\
|
||||
18 Symptoms, Signs etc. & 1.000 & 0.062 & 0.625 & -0.332 & -0.265 & -0.069 & 0.062 & 0.194 & 0.390 & 0.456 \\
|
||||
19 Injury etc. & 0.000 & 0.063 & 0.625 & -0.337 & -0.268 & -0.069 & 0.062 & 0.196 & 0.392 & 0.459 \\
|
||||
20 External Causes & 0.000 & 0.063 & 0.625 & -0.330 & -0.266 & -0.070 & 0.064 & 0.194 & 0.392 & 0.460 \\
|
||||
21 Contact with Healthcare & 0.000 & 0.063 & 0.627 & -0.335 & -0.267 & -0.070 & 0.064 & 0.194 & 0.390 & 0.454 \\
|
||||
22 Special Purposes & 0.000 & 0.062 & 0.625 & -0.335 & -0.268 & -0.070 & 0.062 & 0.194 & 0.391 & 0.456 \\
|
||||
\hline
|
||||
\end{tabular}
|
||||
\end{table}
|
||||
|
||||
|
Before Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 356 KiB |
|
Before Width: | Height: | Size: 246 KiB |
|
Before Width: | Height: | Size: 249 KiB |
|
Before Width: | Height: | Size: 248 KiB |
|
Before Width: | Height: | Size: 253 KiB |
|
Before Width: | Height: | Size: 251 KiB |
|
Before Width: | Height: | Size: 248 KiB |
|
Before Width: | Height: | Size: 345 KiB |
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 172 KiB After Width: | Height: | Size: 280 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 327 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 158 KiB |
|
Before Width: | Height: | Size: 80 KiB |
@ -0,0 +1,26 @@
|
||||
% latex table generated in R 4.5.1 by xtable 1.8-4 package
|
||||
% Mon Mar 23 23:42:59 2026
|
||||
\begin{table}[ht]
|
||||
\centering
|
||||
\begin{tabular}{lcccccccc}
|
||||
\hline
|
||||
category\_name & N & mean & P(p$>$0) & 5\% & 25\% & median & 75\% & 95\% \\
|
||||
\hline
|
||||
ICD-10 \#1: Infections \& Parasites (n=20) & XX & 1.60 & 77.23 & -1.79 & 0.11 & 1.19 & 2.77 & 6.30 \\
|
||||
ICD-10 \#2: Neoplasms (n=49) & XX & 3.63 & 90.17 & -0.90 & 1.52 & 3.37 & 5.52 & 9.06 \\
|
||||
ICD-10 \#3: Blood \& Immune system (n=1) & XX & 0.15 & 62.35 & -0.80 & -0.02 & 0.01 & 0.16 & 1.63 \\
|
||||
ICD-10 \#4: Endocrine, Nutritional, and Metabolic (n=10) & XX & 2.23 & 82.05 & -1.75 & 0.52 & 2.03 & 3.77 & 6.89 \\
|
||||
ICD-10 \#5: Mental \& Behavioral (n=8) & XX & 3.42 & 76.72 & -4.21 & 0.24 & 3.36 & 6.47 & 11.28 \\
|
||||
ICD-10 \#6: Nervous System (n=8) & XX & 0.05 & 52.37 & -2.98 & -0.83 & 0.07 & 0.95 & 3.01 \\
|
||||
ICD-10 \#7: Eye and Adnexa (n=11) & XX & 0.03 & 62.40 & -0.13 & -0.01 & 0.00 & 0.04 & 0.25 \\
|
||||
ICD-10 \#9: Circulatory (n=3) & XX & 0.69 & 57.69 & -5.03 & -1.33 & 0.50 & 2.66 & 6.88 \\
|
||||
ICD-10 \#10: Respiratory (n=7) & XX & 0.04 & 62.21 & -0.17 & -0.00 & 0.00 & 0.03 & 0.37 \\
|
||||
ICD-10 \#11: Digestive (n=12) & XX & 0.02 & 62.13 & -0.10 & -0.00 & 0.00 & 0.02 & 0.18 \\
|
||||
ICD-10 \#12: Skin \& Subcutaneaous tissue (n=9) & XX & 0.55 & 70.42 & -1.06 & -0.11 & 0.41 & 1.10 & 2.56 \\
|
||||
ICD-10 \#13: Musculoskeletal (n=17) & XX & 1.16 & 79.42 & -1.13 & 0.18 & 1.02 & 2.02 & 3.93 \\
|
||||
ICD-10 \#14: Genitourinary (n=2) & XX & 0.13 & 62.72 & -0.54 & -0.01 & 0.00 & 0.10 & 1.27 \\
|
||||
ICD-10 \#17: Congential (n=3) & XX & 0.06 & 62.82 & -0.27 & -0.00 & 0.00 & 0.05 & 0.63 \\
|
||||
\hline
|
||||
\end{tabular}
|
||||
\end{table}
|
||||
|
||||
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 117 KiB |