Hi,
Using the code below, I have been able to obtain predicted probability at age=0 and SRH_B=0. Also, the code uses bootstrap to generate and save 100 margins. I was wondering if there is any way to replicate this for 20 age groups. The code that I have tried to achieve this returns this error:
"option predict() not allowed
an error occurred when bootstrap executed savemargins"

Thanks,
NM

*My current code
svyset raehsamp, strata (raestrat)

capture program drop savemargins
program savemargins, rclass

svy: oprobit SRH_E_new c.age##i.SRH_B c.age#c.age, allbaselevels


margins , predict (outcome (0)) at ( age=0 SRH_B=0 ) atmeans post

end


bootstrap _b, saving(boot_HH, replace) reps(10) : savemargins

use boot_HH, clear
*What I have tried

capture program drop savemargins
program savemargins, rclass

svy: oprobit SRH_E_new c.age##i.SRH_B c.age#c.age, allbaselevels

forvalues i = 1/20 {
margins , predict (outcome (0)) at ( age=`i' SRH_B=0 ) atmeans post
}
end

forvalues i = 1/20 {
bootstrap _b, saving(boot_HH`i', replace) reps(10) : savemargins
}