Change the program to:
program foo2, eclass
tempname bmat
matrix `bmat' = e(b)
matrix b = e(b)
ereturn post b
matrix `bmat'[1,1] = 122
ereturn repost b = `bmat'
end
This seems to work for both -regress- and -logit-
Scott
I'm surprised the original program doesn't work. Something to be aware of
with Scott's solution: most of the ereturned stuff gets zapped once you
run foo2. In particular, since e(predict) gets zapped, the p option on
predict doesn't work. You can probably add lines to Scott's program to
revive the ereturned stuff that gets lost but maybe there is a better
way. The following shows what I am talking about: