Trying to figure out how to combine 2 graphs into 1 plot.
My data set is something like:
x,y,label

I want to plot a regression line (using lm) plus the prediction interval (using predict) of two subsets of my data.
Say I want label==A and label==B. These subsets (A and B) do not have the same number of rows.
So the plot show show two regression lines each with their own prediction interval.
Doing this for the confidence interval is easy (se=TRUE within geom_smooth), but the prediction interval needs to be calculated separately.
Something like:

It always helps if you have a minimal reproducible example with data as we can then take your code directly and work with it.

So within ggplot you can stack combinations of lines and groups. You will see in this example geom_jitter is just to setup the points on the plot while we have 2 x LM being plotted. One for the overall which would be geom_smooth(colour = "black", method = "lm", se = FALSE) + and then geom_smooth(aes(colour= group), method="lm", se=FALSE) + which will be 2 lines, one for each group. As long as you have a column showing group A or B you can add that variable where I specified group and it will draw it.

@GreyMerchant
Thanks!
I guess I'm not too well versed in R yet to fully understand. I also thought about using the parameter, but I can't seem to find a way to combine my two subsets with each a predict interval.
Let me try to give you some more info.

First an example of my data:
id;nfl;age;sex;diagnosis
1;11.2;56;f;SCD
2;14.5;57;m;SCD
3;34.6;63;f;SCD
4;9.04;40;m;SCD
5;10.3;53;f;SCD
6;20.1;67;f;AD
7;19.1;65;m;AD
8;95.8;59;m;AD
9;9.7;53;f;SCD
10;12.8;51;m;AD
11;12;56;m;AD
12;19.5;75;m;AD
13;17.3;64;m;SCD
14;7.12;59;m;AD
15;21.3;53;m;AD
16;16.54;61;m;AD
17;55.71;80;m;AD
18;9.07;63;m;AD
19;7.5;66;m;AD
20;6.25;65;m;SCD

Actually, there are more labels, but I thought I'd keep it to two for the example.
This is what I do now:

Using Shiny with two radio button groups of the to select 1 or 2 diagnosis

When you select diagnosis1 or diagnosis2, I move that subset of data (so just containing that diagnosis) in dataset1 or dataset2. SO: then I have two data sets ready

Then the regression: fit1 <- lm(subset1$nfl ~ subset1$age)

Then the prediciton: pred1 <- predict(fit1, interval="prediction", level=0.95)

Then combine these: plotdata1 <- data.frame(subset1, pred1)

Then I repeat this for the second data set.

Now I use ggplot:
p <- ggplot() +
geom_ribbon(data = plotdata, aes(x=subset1$age,y=subset1$nfl,ymin=lwr, ymax=upr), fill="f0f0f0")+
geom_smooth(data = plotdata1, aes(x=subset1$age,y=subset1$nfl), method=lm, se=FALSE) +

Now this works. However, I can't seem to control the legend now. Nothing seems to be able to override the labels in the legend.
Or perhaps better would be to combine the two plotdata sets (1 and 2) into 1 set and use something like <aes(group=diagnosis)> so ggplot can create both plots by itself - would be easier to ass more data sets if needed too!

So I guess my main question would be: how do I combine both lm+predict results into one single plot so I can use something like <aes(group=diagnosis)> to create both lines and prediction intervals.
Or if I stick to the two lines plot I've got working now: how to manage the legend?