46 lines
1.1 KiB
R
46 lines
1.1 KiB
R
library(tidyverse)
|
|
#library(dsl)
|
|
library(dplyr)
|
|
dsl_csv <-"~/dsl/102725_DSL_df_adac.csv"
|
|
dsl_df <- read.csv(dsl_csv, header = TRUE)
|
|
|
|
outcome_summary <- dsl_df |>
|
|
group_by(source, isAuthorWMF)|>
|
|
summarise(
|
|
total_sum = sum(!is.na(resolution_outcome)),
|
|
count_resolution_outcome = sum(resolution_outcome),
|
|
success_prop = count_resolution_outcome / total_sum,
|
|
median_ttr_days = median(TTR, na.rm = TRUE) / 24
|
|
)
|
|
|
|
|
|
library(ggplot2)
|
|
library(ggdist)
|
|
|
|
|
|
signed_power <- function(x, p) {
|
|
sign(x) * abs(x) ^ p
|
|
}
|
|
|
|
signed_log <- function(x) sign(x) * log1p(abs(x))
|
|
dsl_df <- dsl_df |>
|
|
mutate(
|
|
sp_med_pc3_adac = signed_power(median_PC3_adac, 0.2),
|
|
sp_med_pc4_adac = signed_power(median_PC4_adac, 0.2),
|
|
sl_med_pc4_adac = signed_log(median_PC4_adac),
|
|
sl_med_pc3_adac = signed_log(median_PC3_adac)
|
|
)
|
|
|
|
|
|
ggplot(dsl_df, aes(
|
|
y= log1p(TTR/24),
|
|
x=sl_med_pc4_adac,
|
|
shape=isAuthorWMF,
|
|
color=isAuthorWMF
|
|
)) +
|
|
facet_grid(~source) +
|
|
theme_minimal() +
|
|
geom_smooth(method="loess", span=0.5) +
|
|
geom_point() +
|
|
scale_color_viridis_d()
|