Using mfx to create marginal effects

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Using mfx to create marginal effects

Dear all,

I am trying to estimate the marginal effects of a logit regression using the mfx package. It is crucial that the standard errors are clustered at the year level. Hence, the code looks as follows:

marginal.t24.2<-logitmfx(,data=Data_logitregression_lags, clustervar1 = "year")

marginal.t24.4<-logitmfx(,data=Data_logitregression_lags, clustervar1 = "year")

Is it correct to use clustervar1 = "year" to have year clustered standard errors?

In addition I would like to create a table. I thought that stargazer would be appropriate but the following code is not working:

stargazer(marginal.t24.2, marginal.t24.4, title="Marginal effects result",type="text",out="Marginalt24logit-exportJun2017.txt")

R returns following error:

% Error: Unrecognized object type.

How can I create a table with marginal effects and the corresponding standard errors? Is there an alternative to stargazer?

Thanks for your support in advance.

Kind regards.

        [[alternative HTML version deleted]]

[hidden email] mailing list -- To UNSUBSCRIBE and more, see
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.