I\'m trying to normalize some data which I have in a data frame. I want to take each value and run it through the pnorm function along with the mean and standard deviation of th
You want:
normalize <- apply(hist_data, 2, function(x) pnorm(x, mean=mean(x), sd=sd(x)))
The problem is that you're passing in the individual column into pnorm
, but the entire hist_data
into both the mean & the sd.
As I mentioned on twitter, I'm no stats guy so I can't answer anything about what you're actually trying to do :)