Hi all,

I am trying to replicate the regression analysis shown in the attached picture. The basic specification estimated is a diff-in-diff model:

Array
where Y is log education expenditure in household h in community j in district d at time t,
λ is household fixed effects
MM is a dummy for mobile money users,
N is a dummy for suffering an illness shock,
X, S and C are vectors of various controls,
and γ is a district-specific time trend.

So I am basically looking at whether mobile money users have an advantage over non-users in maintaining education expenditure following an exogenous illness shock.

I have two questions:

1. How do I efficiently calculate (a) the average shock effect, (b) the partial shock effects for mobile money users and non-users, and (c) the overall mean of the shock (cf. highlights in the attached picture)?

For (a), would it be appropriate to use
Code:
 margins, S
For (b), would it be correct to use AMEs
Code:
margins, dydx(S MM)
or rather MEMs
Code:
margins, dydx(S MM) atmeans
And what about (c)?

2. Apologies if this sounds extremely elementary, but what exactly is the difference between running an OLS regression in Stata vs running a panel regression? Is it enough to simply add 'i.hhid' for the added Household FE, or does it imply running a regression via the xtreg command, with specifying the structure of the panel via the xtset command in advance?

I am relatively new to Stata and Statalist so I would appreciate any help.
Many thanks in advance.