Note: Dates are formatted as DD.MM.
I have the closing prices for a number of companies (here: A, B, C) for a time frame (here: Jan 1st to Jan 5th). The df looks like this:
df1 <- data.frame(date = c("01.01.", "02.01.", "03.01.", "04.01.", "05.01."),
A = c(102, 103, 107, 120, 134),
B = c(94, 95, 100, 93, 90),
C = c(55, 53, 50, 51, 48))
The way I want to normalize the data is by using the z-score, so "z = (x – μ) / σ", meaning that for A on 01.01., this would be (102 - 113) / 13.85641 = -0.7938...
How do I apply this to all my observations? I'm guessing with the mutate funcation in dplyr but I can't seem to figure out how to actually do it.
