Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Interaction variables in wyoung (multiple hypothesis testing)

    Hello,

    I am trying to include an interaction term when using the command wyoung. Here is an example of what I am trying to achieve:


    wyoung, cmd("probit outcome treatment female treatment#female, vce(robust)" "probit outcome2 treatment female treatment#female, vce(robust)") familyp(treatment#female) familypexp bootstraps(1000)

    However, Stata always comes back with the following message:

    The following error occurred when running the command lincom treatment#female:
    treatment#female invalid name
    r(198);


    ​​​​​​I have tried various combinations using "i.treatment#i.female", "treatment##female", "1.treatment*1.female", etc., but nothing seems to work.

    I could estimate the models using a pre-created variable treatment_female =treatment*female, but this is - as I understand it - problematic when estimating a probit model.

    Does anyone have any ideas?

    Cheers,
    Alex




  • #2
    Did you try -lincom 1.treatment#1.female- ? That would be the "generic" nomenclature to use with -syntax-.

    That said, different models can have different schemes for naming coefficients. -wyoung- is a user-written program, and I am not familiar with it. Nevertheless, after any Stata estimation command you can find out what names have been used for the coefficients by running -matrix list e(b)-. On the assumption that, like Stata estimation commands, -wyoung- leaves regression results behind in -e()-, that should work for -wyoung-, too. Scan the column headers of e(b) to find the one that reflects the 1.treatment#1.female interaction term and use that in -lincom-. Don't forget to use the equation name, if there is one, as part of the coefficient name when using -lincom-.

    Comment


    • #3
      Thank you, i had forgotten to change the "treatment#female" in familyp(treatment#female), but with 1. everywhere it works. Thanks!

      Comment

      Working...
      X