I am a data scientist working on time series forecasting (using R and Python 3) at the London Ambulance Service NHS Trust. I earned my PhD in cognitive neuroscience at the University of Glasgow working with fmri data and neural networks. I favour linux machines, and working in the terminal with Vim as my editor of choice.
Z-scores are a way of transforming a set of observations such that each represents the number of standard deviations above or below the mean. This is useful since it allows you to compare sets of observations measured on different scales - when fitting models, using standardised scores can aid the interpretation of how much different variables are contributing to the model.
The Z-score is computed in two steps: zero centering the columns (or rows), followed by dividing each value by the standard deviation of the column (or row). For the division step, use the tile method to produce a matrix the same size as the input, with the standard deviation of each column (or row) repeated for each row (or column) and perform a element-wise division:
We create a matrix, call the zscore method and print the result:
Outputs:
< Variance, covariance, standard deviation and standard error
back to project main page
back to home