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

조회 수: 6 (최근 30일)
ShaneS
ShaneS 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
Swarooph
Swarooph 2017년 7월 28일
Does the zscores function help? Doc here.
ShaneS
ShaneS 2017년 7월 29일
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.

댓글을 달려면 로그인하십시오.

채택된 답변

Shruti Shivaramakrishnan
Shruti Shivaramakrishnan 2017년 7월 31일
I think the following explanation should help:
zscore(X,flag,dim)
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: https://www.mathworks.com/matlabcentral/newsreader/view_thread/275744
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개)

카테고리

Help CenterFile Exchange에서 Get Started with Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by