Announcement

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

  • Fixed effects

    Hi All,

    I am quiet unknown with stata, and I was trying to run the following fixed effects model with multiple fixed effects:
    Reghdfe Ideology, absorb(industryid stateid year) cluster ()

    However I first need to destring the state and industry (see image). Destring for industry works as it is numerical, yet State is a text variable. Can somebody maybe explain me how I add State to my model as a fixed effect? I hope my question is clear, my apologies for the ignorance....

  • #2
    Click image for larger version

Name:	Screenshot 2021-12-07 133231.png
Views:	1
Size:	11.5 KB
ID:	1639841
    Foto

    Comment


    • #3
      Code:
      help encode
      I'm sympathetic to you as a new user of Stata - there is quite a lot to absorb. And even worse if perhaps you are under pressure to produce some output quickly. Nevertheless, I'd like to encourage you to take a step back from your immediate tasks.

      When I began using Stata in a serious way, I started, as have others here, by reading my way through the Getting Started with Stata manual relevant to my setup. Chapter 18 then gives suggested further reading, much of which is in the Stata User's Guide, and I worked my way through much of that reading as well. All of these manuals are included as PDFs in the Stata installation and are accessible from within Stata - for example, through the PDF Documentation section of Stata's Help menu.

      The objective in doing the reading was not so much to master Stata - I'm still far from that goal - as to be sure I'd become familiar with a wide variety of important basic techniques, so that when the time came that I needed them, I might recall their existence, if not the full syntax, and know how to find out more about them in the help files and PDF manuals.

      Stata supplies exceptionally good documentation that amply repays the time spent studying it - there's just a lot of it. The path I followed surfaces the things you need to know to get started in a hurry and to work effectively.

      Stata also supples YouTube videos, if that's your thing.

      Comment


      • #4
        Marco:
        William's comment gives you excellent guidance and anticipate that it is unlikely that Stata commands are learnt once and for all (and William said it very clear and true, as we all learnt this lesson upon our first steps in Stata realm).
        That said, you may want to consider the following toy-example, that elaborates on William's helpful suggestion:
        Code:
        . use "https://www.stata-press.com/data/r16/auto.dta"
        (1978 Automobile Data)
        
        . encode make, g(make_num)
        In addition, please note that -encode- behaves nasty under some conditions (or, to tell the truth, is sometimes misused); just to link to William's wise advice, take a look at -encode- entry in Stata .pdf manual.
        As an aside, please read and act on the FAQ that, among many useful advice, discourage sharing screenshot (and for very good reasons). Thanks.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment

        Working...
        X