Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • mimrgns – problem of including ‘.class’ file format

    I would like to calculate average marginal effects after running a linear regression with multiple imputed values.
    I'm accessing my data by using a remote access. This just allows me to include do-files and ado-files. I found the mimrgns ado-file but realized when including the ado-file that there are 3 files to include (1) mimrgns.ado, (2) mimrgns_estimate.ado and (3) mimrgns_work.class
    As I can't use the file format '.class' when using the remote access I wonder if I can skip the inclusion of 'mimrgns_work.class' and just include the mimrgns.ado and mimrgns_estimate.ado in my do-file program.
    The command seems to work also without mimrgns_work.class. What does mimrgns_work.class do? When do I need 'mimrgns_work.class'?

    My relevant commands are

    adopath ++${prog}
    which mimrgns.ado
    which mimrgns_estimate.ado
    *which mimrgns_work.class <-- I cannot include this when using the remote access

    mi estimate, saving(miestfile, replace) esample(esample): xtreg logwage i.man##c.unemployment i.education , fe robust
    mimrgns using miestfile, esample(esample) dydx(unemployment) at(unemployment=(0(90)720) man=(0 1))

  • #2
    mimrgns is (most likely) from SSC.


    Originally posted by Wolf Edler View Post
    The command seems to work also without mimrgns_work.class.
    I would be very surprised if it did. What makes you think so?


    Originally posted by Wolf Edler View Post
    What does mimrgns_work.class do?
    At the moment, pretty much everything. More specifically, it does all the syntax parsing, calls mi estimate (mimrgns_estimate.ado), combine the results (for pairwise comparisons), and reports the results. You can actually look at the code yourself

    Code:
    findfile mimrgns_work.class
    doedit `"`r(fn)'"'
    Originally posted by Wolf Edler View Post
    When do I need 'mimrgns_work.class'?
    You do not need to call it, but mimrgns.ado does. And, mimrgns_estimate.ado expects an instance of that class to be passed as its only argument.

    If there is really no possibility to get mimrgns_work.class installed on the remote machine, I believe your best option is to write a simple wrapper for you specific estimation command yourself. This could be as simple as


    Code:
    program mymargins , eclass properties(mi)
        version 15
        xtreg logwage i.man##c.unemployment i.education, fe robust
        margins , dydx(unemployment) at(unemployment=(0(90)720) man=(0 1)) post
    end
    Then call your command as

    Code:
    mi estimate : mymargins foo
    (you may replace foo with any string of your choice)

    This is what mimrgns does at its core. Of course, you will not have all the bells and whistles, e.g., you will get the standard mi estimate output, marginsplot might not work or produce wrong results etc., but for your situation, this is probably your best option.

    Best
    Daniel
    Last edited by daniel klein; 19 Nov 2018, 04:15. Reason: corrected syntax error in mi estimate call

    Comment


    • #3
      Thank you very much for your fast response!

      Comment

      Working...
      X