MATLAB Answers


Beginner: How to get age-adjusted Z scores of a variable?

さんによって質問されました 2017 年 7 月 28 日
最新アクティビティ Shruti Shivaramakrishnan さんによって 回答されました 2017 年 7 月 31 日
Hi Everyone,
I have a 25 (subjects) x 68 (variables) matrix. I also have a variable called Age (25 x 1). Now, I would like to get the age-adjusted values of the 68 variables. Could someone teach me how to do that please?
Thanks very much!

  2 件のコメント

Does the zscores function help? Doc here.
Hi there,
Thanks. What I am trying to do is to get use MATLAB to get the age-adjusted values of the raw data.
Following that, I will like to transform into Z scores against the mean and SDs from another group.
Thanks for your time.

サインイン to comment.

1 件の回答

 Accepted Answer

I think the following explanation should help:
If flag is 0 (default), then zscore scales X using the sample standard deviation...
If flag is 1, then zscore scales X using the population standard deviation
zscore(X,flag,dim) standardizes X along dimension dim
Also, if you would like to use zscore functionality without the Statistics and Machine Learning Toolbox, the following answers discussion might help:
Also the "bsxfun" function can help you combine the two functionalities with bsxfun(@rdivide, bsxfun(@minus, Data, meanvalue), standard deviation value)
mean can be calculated using the "mean" function and standard deviation using "std"

  0 件のコメント

サインイン to comment.

Translated by