0
library(data.table)
library(survival)
library(survminer)
library(dcurves)

I have df as follows

structure(list(PatientID = c(1001L, 1002L, 1003L, 1004L, 1006L, 
1014L, 1015L, 1016L, 1018L, 1022L, 1024L, 1032L, 1040L, 1042L, 
1049L, 1056L, 1059L, 1060L, 1066L, 1084L, 1087L, 1090L, 1093L, 
1096L, 1097L, 1098L, 1099L, 1200L, 1205L, 1216L, 1221L, 1222L, 
1225L, 1226L, 1233L, 1239L), TimeMonths = c(9L, 8L, 69L, 104L, 
104L, 100L, 24L, 85L, 100L, 99L, 67L, 58L, 7L, 94L, 93L, 90L, 
91L, 90L, 89L, 72L, 84L, 84L, 11L, 82L, 39L, 46L, 82L, 82L, 9L, 
34L, 75L, 76L, 52L, 20L, 29L, 70L), Event = c(1L, 0L, 0L, 0L, 
0L, 0L, 1L, 1L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
0L, 0L, 1L, 0L, 1L, 1L, 0L, 0L, 1L, 1L, 0L, 0L, 1L, 1L, 1L, 0L
), P1 = c(0.1, 0.03, 0.02, 0.05, 0.01, 0.04, 0.03, 
0.06, 0.02, 0.03, 0, 0, 0.11, 0.01, 0.03, 0, 0.01, 0.01, 0.01, 
0, 0, 0, 0.05, 0.01, 0, 0, 0, 0, 0.04, 0, 0.07, 0.01, 0.01, 0, 
0, 0), Age = c(88L, 49L, 60L, 46L, 50L, 60L, 38L, 74L, 39L, 65L, 
80L, 35L, 54L, 40L, 54L, 55L, 60L, 38L, 64L, 74L, 71L, 57L, 55L, 
49L, 42L, 30L, 63L, 46L, 47L, 58L, 34L, 72L, 50L, 60L, 73L, 51L
), Grade = c(2L, 2L, 2L, 3L, 3L, 1L, 2L, 2L, 2L, 1L, 2L, 1L, 
3L, 1L, 3L, NA, 2L, 3L, 2L, 2L, 2L, NA, 2L, 2L, 2L, 2L, 2L, 1L, 
2L, 2L, 2L, 2L, 3L, 2L, 2L, 2L), Tsize = c(2.5, 6, 4, 4, 3.5, 
1.8, 1.5, 1.5, 2, 3.5, 4, 2, 4.5, 3, 3, 2, 3, 1.5, 2.5, 5, 5, 
3, 6, 3, 2.5, 5, 1.5, 2, 5.5, 5, 3, 6, 4, 3.5, 4, 5), LNstatus = c(0L, 
1L, 0L, 0L, 0L, 0L, 1L, 1L, 0L, 1L, 0L, 1L, 1L, 0L, 0L, 0L, 0L, 
0L, 0L, 0L, 1L, 0L, 1L, 0L, 1L, 1L, 1L, 0L, 0L, 1L, 1L, 0L, 1L, 
1L, 1L, 0L), Time = c(5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 
5, 5), Model1 = c(0.0754111003682264, 0.789025824308725, 0.0888669573431788, 
0.162944690463524, 0.148205788806964, 0.0232412222825853, 0.335639290548721, 
0.427877640015971, 0.0437151408243315, 0.340118759660636, 0.104749557872707, 
0.191041558905319, 0.901494025297558, 0.0271621117477482, 0.134690848022469, 
NA, 0.0681964605449713, 0.0799110215826685, 0.0617151301818596, 
0.129265190806531, 0.760358458474655, NA, 0.805815477115913, 
0.0622010539620427, 0.4275233016386, 0.632818820863808, 0.39812097019303, 
0.0217733118415042, 0.118190758626649, 0.721016961718498, 0.449778991144841, 
0.164102951793386, 0.857780996059435, 0.576334735175668, 0.668186510212559, 
0.107238793230798), Model2 = c(0.444752330666943, 0.930853771862407, 
0.0980811416950194, 0.311714208416219, 0.108779198079316, 0.0297296718406789, 
0.255165235219636, 0.652922467522166, 0.0301952043412281, 0.405213119172736, 
0.0800242041001141, 0.0767147984837693, 0.999999999862285, 0.0181219543140756, 
0.14865830843794, NA, 0.0496630840467432, 0.0382325860289233, 
0.0421016493675688, 0.113455005788149, 0.665969059849803, NA, 
0.991966233874329, 0.0424861062828985, 0.206267128670341, 0.453591375821231, 
0.180419209497713, 0.00979786791522574, 0.243955485600603, 0.596589087934302, 
0.778048018064795, 0.211053490646643, 0.747102269303274, 0.37666971629859, 
0.511588083962541, 0.0826035699229486)), class = "data.frame", row.names = c(NA, 
-36L))

I tried following code to generate the dca

dca(Surv(Time, Event) ~ Model1 + Model2, data = dfs,
label = list(Model1 = "Model1", Model2 = "Model2"), time = 5, thresholds = 1:35 / 100) %>% plot(smooth = TRUE)

output

Now I want to display the values of y axis at a specific x value for Model1 and Model2. It's approximately 0.255 and 0.300 respectively

Expected output expected

  • `geom_text` or `geom_label`. Or `annotate`. – Limey Dec 08 '22 at 08:46
  • no. I want the exact value to be displayed at intersection of x with y. `x =0.2`. The values which I have plotted on figure is approximate –  Dec 08 '22 at 09:40

0 Answers0