Allen Huang
  • Home
  • Publications
  • Working Papers
  • Judge Ideology
  • Coding
  • Blockchain & Crypto

SAS Codes:

I'm an old-school SAS guy and over the years have accumulated some SAS codes/macros. Here are some of them.

1. winsorize.sas
This is a SAS macro to winsorize selected variable at the defined top and/or bottom percentages. For example, you can winsorize variables ATQ, EPSPX at the top and bottom 1%, or top 1% and bottom 5%, etc. The macro is also capable of winsorizing variables within a group. For example, if you want to winsorize NIQ within each industry-year.


2. truncate.sas
This is a SAS macro to truncate selected variable at the defined top and/or bottom percentages. For example, you can truncate variables ATQ, EPSPX at the top and bottom 1%, or top 1% and bottom 5%, etc. The macro is also capable of truncating variables within a group. For example, if you want to truncate NIQ within each industry-year.

3.
Demerjian and Owens 2016 PVIOL.sas
This is a SAS macro to calculate the probability of default for Dealscan loans following Demerjian and Owens (2016 JAE) paper. I can't guarantee this is correct, if you find any errors, please email me.
Powered by Create your own unique website with customizable templates.
  • Home
  • Publications
  • Working Papers
  • Judge Ideology
  • Coding
  • Blockchain & Crypto