This is a test version of Biostars. For the public version, visit https://www.biostars.org.
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)
r

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 scale with median and apply to get to where you need. apply the median function to the scaled dataset along the dimension of interest.

one step more: apply(z,2,median)

0 answers

No answers yet.

Log in to answer this question.