Announcement

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

  • Merge Compustat with Boardex and Tresgs data

    Hi,

    I want to study the effect of Board gender diversity on Firm financial performance, with the mediating role of CSR (tresGS) IN THE S&P 500 firms.

    I have the Firm financial performance (Compustat) data in a Stata file. With the use of Cusip numbers of S&P500 firms.

    I want for these s&p 500 companies the board gender diversity data using Boardex. But i do not know how to merge them after.

    Also for the TRESGS , i have data but this is with a DS_code

    I want to merge all of it into 1 stata file . How can i do this?

  • #2
    Hey, please give data examples for each dataset you speak of (that is, we should see 3 individual blocks of data examples). See the FAQ for more. For a visual of what specifically I mean, watch this. Welcome to Statalist!

    Comment


    • #3
      Hallo Mathe,

      in order to merge different datasets you have to make sure that the variables your are merging on (such as a firm ID and year) are the same across the different datasets. They need to have the same name and they need to contain the same type of IDs. Open all datasets seperately and adjust first if necessary.

      Once that is done you can use roughly the following commands:

      Code:
      use "compustat.dta", clear
      merge 1:1 ID year using "boardex.dta"
      drop _merge
      merge 1:1 ID year using "tresgs.dta"
      drop _merge
      If not every firm is included in every dataset and year you can play around with 1:1 (1:m or m:1 but never ever m:m).

      Make sure to examine visually whether the merge was correct.

      Hope that helps!
      Sebastian

      Comment

      Working...
      X