Hi all,

I am using the margins command to predict probabilities. I ran 5 separate logistic regression for each subgroup (block) of my sample.

foreach blo of numlist 1(1)5 {
logit y x1 x2 x3 x4 if block==`blo'
qui margins if block==`blo', at((mean) _all x1=(1(1)10)) over(x2))
.....
}

My question is: for the part at((mean) _all x1=(1(1)10)) over(x2)) , is margins predicting the probabilities at the means of covariates x3 and x4 within each block (i.e. block-specific means), or at the means of x3 and x4 of the whole sample? If it is the latter, is there any efficient way of telling Stata to do it at the block-specific means of x3 and x4?

Thank you very much!