<p>It is difficult to understand what you are truly looking for, but I think I have a rough idea. I think you want to plot the survival curve that would have been observed if every person in your sample had received a specific value for the continuous covariate. If there is no confounding, you can simply use a Cox model that includes only the continuous covariate and use the <code>predict()</code> function for a range of points in time and plot the results. If you need to adjust for confounding, you can include the confounders in the Cox model and use <em>g-computation</em> to obtain the desired probabilities. I describe this in a recent preprint: <a href="https://arxiv.org/pdf/2208.04644.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/2208.04644.pdf</a></p>
<p>This can be done in R using the <code>contsurvplot</code> package (also developed by me). First, install the package using:</p>
<pre><code>devtools::install_github(&quot;RobinDenz1/contsurvplot&quot;)
</code></pre>
<p>Afterwards, fit your Cox model, but use <code>x=TRUE</code> in the <code>coxph</code> call:</p>
<pre><code>library(survival)
library(contsurvplot)
library(riskRegression)
library(ggplot2)

fit2 &lt;- coxph(Surv(stop, event) ~ size + rx, data=bladder, x=TRUE)
</code></pre>
<p>You can now call the <code>plot_surv_lines</code> function to obtain the causal survival curves for specific values of <code>size</code>, given the model. Using the <code>horizon</code> argument you can tell the function for which values you want to plot the survival curves. I choose the 20% and 80% quantile of <code>size</code> as you described:</p>
<pre><code>plot_surv_lines(time=&quot;stop&quot;,
                status=&quot;event&quot;,
                variable=&quot;size&quot;,
                data=bladder,
                model=fit2,
                horizon=quantile(bladder$size, probs=c(0.2, 0.8)))
</code></pre>
<p><a href="https://i.stack.imgur.com/BV1lG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BV1lG.png" alt="example_lines" /></a>
The package contains a lot more plotting routines to visualize the causal effect of a continuous variable on a time-to-event outcome that might be more suitable for what you actually want.</p>
Predicted Survival Curves using Corrected Group Prognosis Method
<p>How can I plot predicted survival curves of a continuous covariate (let's say 20th and 80th percentile of the value) using the corrected group prognosis method as implemented in R by <a href="https://cran.r-project.org/web/packages/survival/vignettes/adjcurve.pdf" rel="nofollow noreferrer">Therneau</a></p>

<p>For example, </p>

<pre><code>library(survival)
library(survminer)

fit &lt;- coxph( Surv(stop, event) ~ size + strata(rx), data = bladder )

ggadjustedcurves(fit, data=bladder, method = "conditional", strata=rx)
</code></pre>

<p>Now, this is useful because I am given two survival curves that are stratified by rx (either 0 or 1) and the conditional method is being acted upon the bladder data set. However, let's say I would like to use the marginal method but <em>not stratify</em> and instead plot my continuous covariate at 20th and 80th value but also re-balance the subpopulation. Would like any step in the right direction.</p>

<p>To re-state, I have a Cox model with continuous predictors. I would like to build a Cox model but not stratify on rx but have this in the model. Then, I want to pass the created Cox object into ggadjustedcurves() function with uses "subpopulation re-balancing" when given a reference data set. And then, instead of showing two survival curves stratified on a categorical variable, I want to plot two representative survival curves at the 20th and 80th percentile.</p>

<p><strong>EDIT</strong></p>

<p>My first attempt</p>

<pre><code>fit2 &lt;- coxph( Surv(stop, event) ~ size + rx, data = bladder ) #remove strata
fit2

# CGP

pred&lt;- data.frame("rx" = 1, "size" = 3.2)

ggadjustedcurves(fit2, data = pred , method = "conditional", reference = bladder)
</code></pre>

<p>Is this what I think it is? Conditional re-balancing has been applied to the reference data set and then the predicted curves are generated for an individual with rx=1 and size of 3.2.</p>