Posts

Pad Character Variables with Leading Zeros - SAS Tutorial (3)

Feb 29, 2020
WRDS/SAS Tutorial
WRDS, SAS, STATA

Working with WRDS data, sometimes we’ll want to add leading zeroes to certain variables, for example, CIK. CIK (Central Index Key) is a 10-digit number used by SEC as an entity identifier. Say there is a CIK field in a dataset. If it is stored as a numeric variable, then most software will ignore leading zeroes. As a result, the imported dataset may look like: cik file_type date 1000229 8-K 2011-09-30 100591 8-K 2006-05-11 100826 8-K 2009-06-30 93542 8-K 2007-01-25 To convert the numerically stored CIK to 10-digit character variable, we need to pad it with leading zeros. ...

Hugo Updates, S3 and CloudFront

Feb 27, 2020
Hugo, S3

Two days ago I updated Hugo to version 0.65.3 before moving this site from my EC2 to S3. Then I realized that in recent updates, Hugo dropped pygments as a dependency (#4491). As a result, all SAS codes on this site lost syntax highlights, because the highlighter chroma used by Hugo had not yet supported SAS language. After trying different options like using client-side syntax highlighter, I gave up and decided to add SAS support myself for chroma. ...

What it takes to be a CEO? A fun survey of literature.

Feb 4, 2020
CEO, Compensation, Literature

Taking up the position of CEO means more than pressure from the board and investors. You’ll also face heavy scrutiny from academia. Whether or not a firm’s hiring and compensation committees use them as a reference, here are some of the findings that you may want to be aware of. Upon birth There are many things determined when you’re born. It’ll be naive to think that they matter less than anything else. ...

Working Remotely on a Windows Machine from VSCode on a Mac

Jan 28, 2020
SSH

Now I only need a MacBook (1.3 GHz dual-core i5) to do all my work anywhere, thanks to a powerful workstation provided by the university. Yet the workstation is based on Windows 10 and sitting behind the university VPN. I don’t want to use Remote Desktop everytime I need to do some coding, so I decided to make it so I can code remotely on the workstation but from the lovely VSCode on my little Mac. ...

Specification Curve

Nov 29, 2019
Specification Curve

A couple of days ago, Rawley Heimer from Boston College visited our discipline and gave a seminar on research methods and journal publication insights for us PhD students. He’s an interesting guy and I was very impressed by a method he introduced to us - Specification Curve. Motivation More offen than not, empirical researchers need to argue that their chosen model specification reigns. If not, they need to run a battery of tests on alternative specifications and report them. ...

Use WRDS Macros - WRDS/SAS Tutorial (2)

Nov 14, 2019
WRDS/SAS Tutorial
WRDS, SAS

Most junior research students did not have any experience with data manipulation and analysis with SAS and the Wharton Research Data Services (WRDS), which motivates me about this tutorial series. This post explains how to use those handy macros on WRDS when you use remote submission, following the previous one on how to encode your WRDS password and use remote submission to run your code on the WRDS cloud. ...

Display PageViews and List of Popular Posts on a Static Site

Sep 6, 2019
Hugo, Static Site, Pageview

A static site, like this one based on Hugo, cannot easily display site statistics. But there’s a solution. When the page is loaded on the client side, a Javascript pulls the relevant statistics from my server then render it to the page. The server runs a small Python program to contact Google Analytics API in order to get the statistics and return to the frontend. We can even use it to build a list of popular posts. ...

Beta - Unlevered and Levered

Sep 5, 2019
Beta

Beta is a measure of market risk. Unlevered Firm $u$ If a firm has no debt, it’s all equity-financed and thus its equity’s beta $\beta_{E}$ equals its asset’s beta $\beta_{A}$. This beta is also the unlevered beta, $\beta_{\text{unlevered}}$, since it’s unaffected by leverage. The unlevered beta measures the market risk exposure of the firm’s shareholders. Let’s call this firm $u$, Hence, we have: \begin{equation} \beta_{\text{unlevered}}=\beta_E^u=\beta_A^u \end{equation} This equality says that in an unlevered firm, the unlevered beta equals its equity beta and its asset beta. ...

用期货来管理体重

Sep 4, 2019

你是否还在为迟迟无法减轻体重而苦恼?! 天天去健身房太累!绝食太幸苦!—— “我放弃……” 不!我们金融人要用金融的方法来解决问题!

这篇文章来介绍一下我和我老婆的最新协议,用期货来管理体重

...