benjann / lnmor

Stata module to compute marginal odds ratios after model estimation
MIT License
3 stars 1 forks source link

r(table) for lnmor (?) #1

Open ericmelse opened 1 year ago

ericmelse commented 1 year ago

Dear Ben,

After using lnmor the coefficient vector is provided by using the matrix r(b). But, would it be possible to also add to the result Matrices r(table) as to have the values available of the Robust standard error, t, P>|t|, as well as the upper and lower limit of the confidence interval (as reported by lnmor)?

Much obliged. Eric

ericmelse commented 1 year ago

Dear Ben,

I have another question. When I run lnmor while using the option or then the coefficient vector that is saved in the matrix r(b) appears to have the logit value and not the exponentiated value (i.e. the odds ratio). Ofcourse, that can be calculated manually but I suggest to save it as such because that makes more sense for further use and also it is more convenient when you follow up on my previous request.

Best, Eric

PS I did find code how to exponentiate a matrix B (replacing its logit value by the exponentiated value): mata : st_matrix("B", exp(st_matrix("B")))

benjann commented 1 year ago

Good idea. I'll see that I can change the code such that r(table) is returned, containing ORs depending on context.

benjann commented 1 year ago

Matrix r(table) was returned by lnmor if option post was specified. I now modified the code such that r(table) is returned also if post is omitted. If option or is specified, r(table) will contain ORs.