I am experiencing what seems to be a compatibility issue between the user-written packages f_able (f_rcspline) and did2s in Stata 18 (both installed from SSC).
When generating natural spline basis variables with f_rcspline and including them in the second stage of did2s, I receive the following error:
"command double is unrecognized"
Example code:
f_rcspline alderpaaselskapet = alderpaaselskapet, nknots(4)
did2s lnopa, first_stage(org regnskapsår) ///
second_stage(c.l_D_oppslag##c.l_D_kurs##c.l_D_over sikt ///
c.l_D_oppslag#c.alderpaaselskapet ///
c.l_D_oppslag#c.alderpaaselskapet2 ///
c.l_D_oppslag#c.alderpaaselskapet3) ///
treatment(l_D) cluster(org)
margins, dydx(c.l_D_oppslag c.l_D_kurs c.l_D_oversikt)
f_able alderpaaselskapet2 alderpaaselskapet3, auto
margins, dydx(c.l_D_oppslag) at(alderpaaselskapet = (0(15)126))
This workflow runs as expected using xtreg but fails with did2s.
Is this a known limitation of either package? Are there workarounds for using spline basis variables with did2s?
Any advice appreciated.
Emil Mathias Strøm Halseth
When generating natural spline basis variables with f_rcspline and including them in the second stage of did2s, I receive the following error:
"command double is unrecognized"
Example code:
f_rcspline alderpaaselskapet = alderpaaselskapet, nknots(4)
did2s lnopa, first_stage(org regnskapsår) ///
second_stage(c.l_D_oppslag##c.l_D_kurs##c.l_D_over sikt ///
c.l_D_oppslag#c.alderpaaselskapet ///
c.l_D_oppslag#c.alderpaaselskapet2 ///
c.l_D_oppslag#c.alderpaaselskapet3) ///
treatment(l_D) cluster(org)
margins, dydx(c.l_D_oppslag c.l_D_kurs c.l_D_oversikt)
f_able alderpaaselskapet2 alderpaaselskapet3, auto
margins, dydx(c.l_D_oppslag) at(alderpaaselskapet = (0(15)126))
This workflow runs as expected using xtreg but fails with did2s.
Is this a known limitation of either package? Are there workarounds for using spline basis variables with did2s?
Any advice appreciated.
Emil Mathias Strøm Halseth
Comment