Skip to content

Instantly share code, notes, and snippets.

View JoostImpink's full-sized avatar

Joost Impink JoostImpink

View GitHub Profile
@JoostImpink
JoostImpink / google_vs_industry_MTB.sas
Last active July 30, 2021 15:41
Google vs industry MTB benchmark
/* Example of how to use SAS to retrieve data from WRDS
Computing market-to-book ratio for years 2000-, and benchmark it against
other firms in the industry */
/* this piece of code makes a connection of your SAS instance with WRDS remote server */
%let wrds = wrds-cloud.wharton.upenn.edu 4016;options comamid = TCP remote=WRDS;
signon username=_prompt_;
/* any code executed on WRDS needs to go in a remote submit block, for example: */
@JoostImpink
JoostImpink / hayn_4_table_4b_assignment.sas
Created May 17, 2016 14:16
Hayn 1995 replicate table 4b assignment
proc sort data=g_sample_wins; by gvkey;run;
proc reg data= g_sample_wins;
model ret = e_p ;
ods output ParameterEstimates = regout_1a FitStatistics = regout_1b;
/* adding by gvkey will result in separate regressions for each firm */
by gvkey;
quit;
@JoostImpink
JoostImpink / createDummyVars.sas
Created July 1, 2016 17:24
Macro to create dummy variables (non-missing values only)
/* Helper macro to make dummy variables
Note: it is not robust for missing values
*/
%macro createDummyVars(dsin=, var=, newvar=);
proc sql noprint;
select distinct &var. into :mvals separated by '|'
from &dsin.;
/* Number of unique values */
%let mdim=&sqlobs;
quit;

Keybase proof

I hereby claim:

  • I am JoostImpink on github.
  • I am impink (https://keybase.io/impink) on keybase.
  • I have a public key whose fingerprint is 3B29 169E 938B 866A 7CBF 3085 3F4E 2E9E 02B9 C853

To claim this, I am signing this object: