LoslegenKostenlos loslegen

Calculating Valuation Multiples

Using the Pharmaceuitcal firms you have identified in the prior exercise (the data of which is stored in the pharma data object), calculate the P/LTM EPS, P/NTM EPS, and P/BVPS for the comparable companies. P is the market price of the stock, EPS is earnings per share, and BVPS is book value of equity per share.

Note that, in practice, there are times when the EPS or BVPS is not populated from the commonly used databases. Therefore, you have to make sure your code is adequately flexible to only calculate multiples when the EPS or BVPS is positive. If the EPS or BVPS is not positive (i.e., less than or equal to 0), your code should set the value of that multiple equal to NA.

For this exercise, you should use the ifelse() argument to set non-positive values equal to NA. Otherwise, for positive values, we can calculate the valuation multiple.

Diese Übung ist Teil des Kurses

Equity Valuation in R

Kurs anzeigen

Anleitung zur Übung

  • Calculate P/LTM EPS.
  • Calculate P/NTM EPS.
  • Calculate P/BVPS.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Calculate P/LTM EPS
pharma$ltm_p_e <- ifelse(___, ___, ___)

# Calculate P/NTM EPS
pharma$ntm_p_e <- ifelse(___, ___, ___)

# Calculate P/BVPS
pharma$p_bv <- ifelse(___, ___, ___)
pharma
Code bearbeiten und ausführen