Okay. You will need to subset your population. You can either create these subpopulations already from the data frames and with read_pumas, or we can filter later. The vpc
function has a function that accepts a model, population, and coefficients. This following has covariates so illustrates the idea, but it is not a continuous outcome so you cannot use prediction correction here 
using PumasPlots
using PumasPlots.Pumas
using Pumas.CSV
using Pumas.DataFrames
using Random
using StableRNGs
import PharmaDatasets
df = PharmaDatasets.dataset("pumas/pain_remed")
pop = read_pumas(
df;
observations = [:dv],
covariates = [:arm, :dose, :conc, :painord, :remed],
event_data = false,
)
model = @model begin
@metadata begin
desc = "Logistic Regression Model"
end
@param begin
"Intercept"
intercept ∈ RealDomain(init = 0.001)
"Slope"
tvslope ∈ RealDomain(init = 0.0001)
"""
- Ω
"""
Ω ∈ VectorDomain(1)
end
@random begin
η ~ MvNormal(Ω)
end
@covariates begin
"Study Arm"
arm
"Dose (mg)"
dose
end
@pre begin
rx = dose > 0 ? 1 : 0
slope = tvslope * rx
logit = intercept + slope + η[1]
end
@derived begin
"Pain Relief"
dv ~ @. Bernoulli(logistic(logit))
end
end
param = (intercept = 0.001, tvslope = 0.0001, Ω = [1.0])
fit1 = fit(model, pop, param, Pumas.FOCE(), ensemblealg = EnsembleThreads())
vpc1 = vpc(
model,
pop,
coef(fit1),
samples = 200,
stratify_by = [:arm, :dose],
ensemblealg = EnsembleThreads(),
rng = StableRNG(1),
)
vpc_plot(vpc1)
pop_arm1_dose5 = filter(x -> x.covariates(0.0).arm == 1 && x.covariates(0.0).dose == 5, pop)
#julia> pop_arm1[1].covariates(0)
#(arm = 1,
# dose = 5,
# conc = 0.0,
# painord = 2,
# remed = 0,)
vpc_arm1_dose5 = vpc(
model,
pop_arm1_dose5,
coef(fit1),
samples = 200,
stratify_by = [:arm, :dose],
ensemblealg = EnsembleThreads(),
rng = StableRNG(1),
# prediction_correction=true,
)
vpc_plot(vpc_arm1_dose5)