How to calculate Mean of median-centered z-score
Hi there,
How is it possible to calculate the Mean of the median-centered z-score? Taking the below script as an example of a data frame. I need to develop a score for each subject. (My dataset is different this is just an example)
Thank you!
Imran
student_id <- seq(1,10)
math <- c(502,600,412,358,495,512,410,625,573,522)
science <- c(95,99,80,82,75,85,80,95,89,86)
english <- c(25,22,18,15,20,28,15,30,27,18)
df_student <- data.frame(student_id,math,science,english)
View(df_student)
z <- scale(df_student[,2:4],center=TRUE,scale=TRUE)
View(z)
• 1,628 views
•
link
0 answers
No answers yet.
Log in to answer this question.
Please explain how this is related to bioinformatics.
I need to develop an immune score related to my research. Unfortunately, my statistic is not that good to solve the problem just applying scale().
You can use
scalewithmedianandapplyto get to where you need.applythemedianfunction to thescaled dataset along the dimension of interest.one step more:
apply(z,2,median)