This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Z prime vs Z score

Hi, I'm hoping someone might be able to help. Is there a simple way in R to calculate Z prime or Z factor vs traditional Z score? I would like to do this for affy data, but only have 4 total samples in my set. Also I have previously been using R-commander for simple statistics- (t-test, anova, Z). I am not very familiar with R, but if I keep the code that commander is running can I just copy and paste directly into R the next time?

r affymetrix

1 answer

z-score = (x-μ)/σ
  • x is a raw gene value to be standardized, in a row,( genes are in rows and samples are in columns)
  • μ is the mean of the row;
  • σ is the standard deviation of the row.

In R, just do

(x-mean(x))/sd(x)

You can find R code for Z-prime here

Some R trivia: the scale function does this for a vector, or down the columns of a matrix.

Log in to answer this question.