Announcement

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

  • interaction terms missing in output--please help!

    Hi all, I'm conducting a diff-in-diff analysis and I'm using margins to test the parallel trends assumption. My outcome variable is "medcost" (0,1) and I've included an interaction term for year (2009-2012, 2016-2019) and treatment (0,1). Here is my code: logit medcost i.year##i.treat2 if _age65yr==1 & mcaid_elig==1 & coverage==0 [pweight=_llcpwt], cluster(_state) allbaselevels

    The output omits 2009 and 2010 and uses 2011 as the base level.

    Thank you in advance for your help and advice!

  • #2
    I figured out the issue! In 2011 BRFSS switched the final weight from "_finalwt" to "_llcpwt".

    Comment


    • #3
      I'm glad you figured it out, and I'm happy that you closed the thread by posting your solution so other's can learn from it. High marks for "citizenship."

      Can I point out something about posting questions effectively? It seems that based solely on the information given in #1 there is no possibility that anybody but you could have arrived at the solution in #2. The post doesn't mention that the data comes from BRFSS. Even if it had, most people here won't know what BRFSS is. And even if, like me, they know what BRFSS is and where to find the data, they would have had to be motivated enough to download the data themselves and work through your problem. My motivation to help out ended there, which is why I did not respond to your post yesterday.

      Moral of the story: in nearly all circumstances when posting a question that involves troubleshooting code, you should also post example data that reproduces the difficulty in question. Had you done that, any interested Forum member could have seen that the weighting variable _llcpwt was mising in 2009 and 2010 and you would have gotten a very prompt and helpful response from somebody (from me if nobody else beat me to it.)

      To make the posting or example data easy, we have the -dataex- command. If you are running version 17, 16 or a fully updated version 15.1 or 14.2, -dataex- is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.

      Comment

      Working...
      X