Hi,
I am running a logit model, for which I am calculating the margins. I need margins for all the explanatory variables, but the "marginsplot" command returns an error. The error is as follows: option dydx() not allowed
The codes that I am using:
Example of my data.
I am running a logit model, for which I am calculating the margins. I need margins for all the explanatory variables, but the "marginsplot" command returns an error. The error is as follows: option dydx() not allowed
The codes that I am using:
Code:
logit outcome_dummy log_base_avgincome1 i.incomechangecat base_hhsize abschange_hhsize i.castecat i.religioncat i.marital_status_category i.educat i.agecat if regioncat==2, vce(cluster hrx) margins, dydx(*) post marginsplot, dydx(castecat)
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte outcome_dummy double log_base_avgincome1 float incomechangecat byte(base_hhsize abschange_hhsize) float(castecat religioncat) long marital_status_category float(educat agecat) 0 9.96716632919931 3 4 0 1 1 2 3 4 0 10.8920989459899 3 7 0 2 1 2 1 3 0 10.8920989459899 3 7 0 2 1 3 1 3 0 10.8920989459899 3 7 0 2 1 3 1 3 1 10.4389570072149 3 6 -1 1 1 2 3 4 0 8.79444606837748 2 4 0 3 1 2 3 1 0 9.56099724358935 2 3 0 3 2 2 3 4 0 10.7733677865876 2 5 0 1 1 2 5 1 0 9.45876173047466 2 5 0 1 1 2 1 5 0 9.30177943229296 3 4 0 2 1 2 5 1 1 9.70351106050345 2 5 0 2 1 2 4 1 1 10.3263012989789 4 3 0 2 3 2 3 5 0 10.3263012989789 4 3 0 2 3 1 1 1 0 10.631386340039 2 4 0 1 3 2 5 5 1 9.73373665291603 3 6 -1 2 2 2 3 4 0 10.1701694058648 3 6 -2 1 1 2 1 4 0 9.68735064724744 3 4 0 2 1 2 4 5 0 9.81524359805304 4 9 -5 2 2 2 5 5 0 10.2752666029895 2 3 0 3 1 2 4 4 0 11.4470527208195 3 3 0 1 3 2 1 4 1 9.57324586566555 3 3 0 1 1 2 4 4 0 10.7851868396407 3 5 0 3 1 2 1 4 end label values marital_status_category marital_status_category label def marital_status_category 1 "Divorced/Separated", modify label def marital_status_category 2 "Married", modify label def marital_status_category 3 "Unmarried", modify label def marital_status_category 4 "Widowed", modify
Comment