I wrote my own code to solve for probit marginal effects, given certain scenarios. (yes, I know there are already functional ones out there written by the eviews proffessionals) So why did I reinvent the wheel? I just felt very inept at the whole procedure, and thought if I could code it from scratch I would learn a lot. I certainly improved my coding ability, but sadly my answer doesn't match the books. Have a look:
Code: Select all
equation eq01.binary(n=d) inlf c educ age nwifeinc exper expersq kidslt6 kidsge6
group derivs
for %i c educ age nwifeinc exper expersq
derivs.add {%i}
next
for !i = 2 to derivs.@count
%c = @str(eq01.@coef(!i))
%v = derivs.@seriesname(!i)
%m = @str(@mean({%v}))
if !i < derivs.@count then
%spec = %spec+%c+"*"+%m+ " + "
endif
if !i = derivs.@count then
%spec = %spec+%c+"*"+%m
endif
next
%discrete_1 = "kidslt6"
%discrete_2 = "kidsge6"
%disvar1 = @str(eq01.@coef(7)*0)
%disvar2 = @str(eq01.@coef(8)*1)
%spec = %spec+ "+" + %disvar1+"+" + %disvar2
%intercept = @str(eq01.@coef(1))
%spec = %spec+"+"+%intercept
scalar prob_estimate = @cnorm({%spec})Thanks for reading
