merging Campaign data and Compustat data

329 views
Skip to first unread message

Maisha Khan

unread,
May 30, 2023, 9:59:09 PM5/30/23
to OpenSecrets Open Data

Hello everyone,

Have any of you ever attempted to merge (in SAS) campaign data from OpenSecrets with data from Compustat? I am currently facing challenges in merging PAC names with their corresponding company names. Could anyone provide some suggestions or assistance on this matter? I would greatly appreciate it.


Maisha

Bryce

unread,
Dec 19, 2023, 10:31:50 AM12/19/23
to OpenSecrets Open Data
Hi,

I'm not sure about SAS but I have a Python script that fuzzy matches between Compustat data (conm and gvkey) and the Open Secrets PAC name columns from the committees table. It uses tf-idf and cosine similarity to match. It's not bad, but requires a fair amount of manual cleaning still. If you throw your CSVs in a dropbox I can send back a matched file. 

Bryce

Rachel

unread,
Dec 23, 2023, 11:16:09 AM12/23/23
to OpenSecrets Open Data

Hi Bryce,

I have the same questions as Maisha. I'm interested in the Python script you mentioned and would appreciate it if you could share the code or if not convenient, some methods and any insights or thoughts you have on the relevant Python libraries or approaches would also be very helpful. Also, I'd like to know if there are any specific considerations or steps I should keep in mind while manually cleaning the data, as you mentioned it still requires some manual cleaning. Any guidance or tips you can provide would be greatly appreciated.

Many thanks,

Rachel

Jesus Salas

unread,
Dec 23, 2023, 11:20:45 AM12/23/23
to opensecret...@googlegroups.com
Some things to keep in mind. Compustat only has the most recent company names… that could cause problems in matching with PACs historically. Second, some companies have more than one PAC because of acquisitions (the acquired company had a PAC that does not die after the acquisition). There is a faculty in accounting at U of Oregon who shares cstat to PAC id (committee id) on his webpage.

Jesus Salas

On Dec 23, 2023, at 11:16 AM, Rachel <wyx10...@gmail.com> wrote:


--
You received this message because you are subscribed to the Google Groups "OpenSecrets Open Data" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opensecrets-open...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/opensecrets-open-data/52398b4b-d0e9-4f40-bb19-3a494c3d7048n%40googlegroups.com.

ying zhao

unread,
Jan 14, 2024, 1:44:53 AM1/14/24
to OpenSecrets Open Data
Dear all,

I am also trying to merge the Campaign Finance Data (PAC data) with the Compustat data at the firm level. I would appreciate it if you could share any information that would be helpful, and I also welcome potential cooperation or a deal.

Thanks!!

Best regards,
Rebecca Zhao
Reply all
Reply to author
Forward
0 new messages