1

Do you know how to plot a case-cohort study where we perform a Cox regression to estimate HR of different covariates, in which I am specially interested in potential molecular biomarkers and its prognostic efficiency. The thing is I tried the available functions in the package 'survminer'. It requires an object class "survfit" which doesn't seem to support 'cch'objects.

As I mentioned I wuld like to assess the prognostic value of several variables. The object comes from a databse with 189 controls and 55 cases. I assess multiple molecular markers, but I will paste the object of one particular and the generic formula applied

Thank you so much as always!


#case-cohort: cch function from the survival package
library(survival)
result <- cch(Surv(timetoevent, event) ~ age+ sex+ smoke+ box + weight + cholesterol+ cholesterol_HDL + molecular_marker, data = dat, subcoh = ~ casecohort2, id = ~parti, cohort.size = 5404, method = "LinYing", robust = TRUE)

The object "cch" in example

asked Apr 29, 2024 at 8:43

1 Answer 1

1

You can get the coefficient table from calling summary on the object. Then, simply convert this to a data frame and plot as you would with any other data frame using ggplot:

library(tidyverse)
summary(example)$coefficients %>%
 as.data.frame() %>%
 rownames_to_column('Variable') %>%
 ggplot(aes(Variable, Value, color = p < 0.05)) +
 geom_hline(yintercept = 0, alpha = 0.1) +
 geom_point(size = 1) +
 geom_errorbar(aes(ymin = Value - 1.96 * SE, ymax = Value + 1.96 * SE),
 width = 0.2) +
 scale_color_manual(values = c('gray50', 'black'), guide = 'none') +
 coord_cartesian(ylim = c(-5, 5)) +
 theme_classic(base_size = 16) +
 theme(axis.line.x = element_blank(),
 axis.ticks.length.x = unit(0, 'mm'),
 panel.grid.major.x = element_line(color = 'gray96'))

enter image description here

answered Apr 29, 2024 at 9:07
Sign up to request clarification or add additional context in comments.

6 Comments

It would be possible to plot a survival curve using i.e. sex as factor?
@JavierHernando I'm not sure what a survival curve using only sex as a factor would look like. Do you mean plotting estimated survival curves for the marginal effect of sex with all other covariates held at their mean? This seems like an artificial and unusual representation.
Well, in the horizontal axis display the time to event. In the Y-axis the estimated survival probability. I would plot using facet functions the most relevant biomarkers using the marginal effect of sex, as you said. Taking average values for the rest of covariates. Maybe I misunderstood something, but aren't these common figures to represent? Appreciete your answer
@JavierHernando in that case your plots would come directly from the Cox model, not from the CCH. You could look at survminer::ggadjustedcurves, which should give you exactly what you are looking for if you give it the Cox model.
this function uses a coxph object. This is the problem is how to pass the object cch to the the function, is it possible to grasp the cox regression arguments necessary to plot them? Because the function due to the case-cohort study design is cch; and the summary(cch_object) gives cch.summary that cannot be passed either.
|

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.