BookmarkSubscribeRSS Feed
shalmali
Calcite | Level 5

Hello Everyone,

 

I have a dataset with the following information: firm_identifier, Year, Executive_Name, and Executive_biography. I want to create a new variable "Expert" that takes value 1 if the executive has a law school degree, such as JD, LL.M., or LL.D., and/or has working experience as a lawyer at, for example, a law firm or as a legal counsel.

 

Is there any SAS code that could read the Executive_biography and create the variable? If so, can someone please share the code with me?

 

The length of executive biographies varies: Some executives' bios are short (ten lines) while some have a long bio (almost a page long). Also the search words (JD, LL.M., LL.D., law firm or  legal counsel) can be placed anywhere in the bios. Also these search words can be in uppercase or lowercase. 

 

Thank you for your time.

 

Regards,

S

 

 

3 REPLIES 3
GreggB
Pyrite | Level 9

Take a look at this: http://www.ats.ucla.edu/stat/sas/faq/index_function.htm

 

Then, you could add:  If x > 0 then Expert=1; else Expert=0;

shalmali
Calcite | Level 5

Hello Everyone,

 

I have a dataset with the following information: firm_identifier, Year, Executive_Name, and Executive_biography. I want to create a new variable "Expert" that takes value 1 if the executive has a law school degree, such as JD, LL.M., or LL.D., and/or has working experience as a lawyer at, for example, a law firm or as a legal counsel.

 

I tried using the following code to create Expert variable.

 


data Want;
set Have;
uline= upcase(Executive_biography);
if find(uline,"LL.M.") and find(uline,"JD") or find(uline,"LL.D.")or find(uline,"LAW FIRM")
or find(uline,"LEGAL COUNSEL")
then do;
Expert=1;
output;
end;
run;

 

This code creates a new dataset where Expert =1. I want a dataset that has all the observations (i.e., Expert =1 and Expert =0). Can somebody please refine this code for me?

 

Thank you for your time.

Regards,

S

shalmali
Calcite | Level 5

Thank you for the suggestion. 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 841 views
  • 1 like
  • 2 in conversation