on-internet
← Community

How can I calculate principal component analysis to plot a graph, showing PC1 vs PC2, using my data set?

Stack Overflow ·

How would I go about making a principal component analysis with the gene data set I have? I have a table containing 15 columns. The first one is disease group, where 0 is control, 1 is Ulcerative Colitis and 2 stands for Crohn’s. The remaining 14 columns correspond to 14 different genes. I would like to plot a PC1 vs PC2 following PCA (via prcomp), to show whether any clustering or separation between the three groups occurs based on gene expression data ( with each axis showing the proportion of variance). However, I am struggling to know where to start, as I cannot convert my column 1 to row

Comments

Sign in or sign up to comment and upvote.

No comments yet.