Dear Statalist,
Greetings!
I was trying to estimate the drivers of farmers adoption decions. My dependant variable is truncated from below - thus applied double hurdle model. I have estimated the model and also calculated average partial effects of continnous explanatory variable for the probability as well as conditional and unconditional expectation. But for binary explanatory variables I could only manage to estimate the average partial effect of the unconditional expected value of the dependent variable as follows - for example.
predict x1g, eq(Tier1)
predict x2b, eq(Tier2)
predict sigma, eq(sigma)
gen xgd0 = x1g if RegionDummy4==0
replace xgd0 = x1g - [Tier1]_b[RegionDummy4] if RegionDummy4==1
gen xgd1 = x1g + [Tier1]_b[RegionDummy4] if RegionDummy4==0
replace xgd1 = x1g if RegionDummy4==1
gen xbd0 = x2b if RegionDummy4==0
replace xbd0 = x2b - [Tier2]_b[RegionDummy4] if RegionDummy4==1
gen xbd1 = x2b + [Tier2]_b[RegionDummy4] if RegionDummy4==0
replace xbd1 = x2b if RegionDummy4==1
gen IMRd0 = normalden(xbd0/sigma)/normal(xbd0/sigma)
gen IMRd1 = normalden(xbd1/sigma)/normal(xbd1/sigma)
gen ped1 = [normal(xgd1)]
gen ped2 = [normal(xgd1)*(xbd1 + sigma*IMRd1)]
gen pe2u_d1 = [normal(xgd1)*(xbd1 + sigma*IMRd1)] - [normal(xgd0)*(xbd0 + sigma*IMRd0)]
sum x1g
local x1gbar = r(mean)
sum x2b
local x2bbar = r(mean)
nlcom [Tier1]_b[ RegionDummy4 ]*normd(`x1gbar')*(`x2bbar'+[sigma]_b[_cons]* (normden(`x2bbar'/[sigma]_b[_cons])/normal(`x2bbar'/[sigma]_b[_cons])))+[Tier2]_b[ RegionDummy4 ]*normal(`x1gbar')*(1-(normden(`x2bbar'/[sigma]_b[_cons])/normal(`x2bbar'/[sigma]_b[_cons]))*(`x2bbar'/[sigma]_b[_cons]+(normden(`x2bbar'/[sigma]_b[_cons])/normal(`x2bbar'/[sigma]_b[_cons]))))
sum pe2u_d1
And, I was wondering if someone could tip me how to compute average partial effects of binary explanatory variables for the probability of adoption and the conditional expected value of the dependent variable.
Thank you for your support,
Best,
Habtamu
Related Posts with Marginal effects of binary explanatory variable after craggit
How to identify and operate characters in a string variable?Hi Statalisters, I am new to Stata and encounter some problems. I have a dataset with some string …
drop duplicates valuesHello, I want to drop duplicates values of a variable if the number of copies are less than five. T…
merge two files.Dear All, I find this question here (in Chinese). There are two files. The first one is something li…
Time dummies to estimate the length of relationshipsI am working with 18 waves of panel data (HILDA) and in each wave, respondents state their marital s…
When I double-click a .dta file, Stata recognizes it as an R file! How to fix it?Today, I went to work on Stata and double clicked a .dta file. The computer presented the message b…
Subscribe to:
Post Comments (Atom)
0 Response to Marginal effects of binary explanatory variable after craggit
Post a Comment