Hi all,
I am writing a Mata function that calculates a VCE for my Stata command, and I want it to be able to handle omitted variables (i.e., those flagged with the prefix "b" or "o"). How do I go about doing this? Is there a canonical method?
Currently, I am passing the matrix r(omit) from -_ms_omit_info- (after swapping the 0s for 1s and vice versa) to Mata and using it with -st_select()- to get the data for the non-omitted variables. I can calculate the VCE for the non-omitted variables, but I want a VCE for all variables (with zeros in the rows and columns for omitted variables, which is the standard in Stata). Do I just have to insert rows and columns of zeros where the omitted variables used to be? If so, is there an efficient way to do so?
I am writing a Mata function that calculates a VCE for my Stata command, and I want it to be able to handle omitted variables (i.e., those flagged with the prefix "b" or "o"). How do I go about doing this? Is there a canonical method?
Currently, I am passing the matrix r(omit) from -_ms_omit_info- (after swapping the 0s for 1s and vice versa) to Mata and using it with -st_select()- to get the data for the non-omitted variables. I can calculate the VCE for the non-omitted variables, but I want a VCE for all variables (with zeros in the rows and columns for omitted variables, which is the standard in Stata). Do I just have to insert rows and columns of zeros where the omitted variables used to be? If so, is there an efficient way to do so?
Comment