This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Formatting Data In R To Perform Factor Analysis Using Psych Package

I'm dealing with a .csv full of RPKM values for various genes by genders, brain region, and age formatted thus:

age        1      1      2      2
gender     m      f      m      f 
region     a      b      c      a 
gene1      4.2    2.2    4.1    3.3
gene2      0.4    2.1    3.2    3.3
gene3      0.1    2.2    3.2    7.2

I want to perform a simple factor analysis as demoed here, but am not sure on how my data needs to be formatted in order to do so.

r analysis

1 answer

At least with FactoMineR, you need a matrix with genes as columns and samples as rows. I recall the psych package functions being the same.

Log in to answer this question.