ComenzarEmpieza gratis

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.

Este ejercicio forma parte del curso

Equity Valuation in R

Ver curso

Instrucciones del ejercicio

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

Ejercicio interactivo práctico

Prueba este ejercicio completando el código de muestra.

# 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
Editar y ejecutar código