Noi/NOTES/2012-5-12: Difference between revisions

From ZhangLabWiki
Jump to navigation Jump to search
>Noi
(Created page with "* http://genome-tech.ucsd.edu/LabNotes/index.php/noi:DMR220k_LabNotes '''Link to calendar''' == Regression analysis of UCLA SZ data, applying LDA function == * Links ** ht...")
 
>Noi
Line 17: Line 17:
  v<-data.frame(pca1$x[,1],pca1$x[,2],pca1$x[,3])
  v<-data.frame(pca1$x[,1],pca1$x[,2],pca1$x[,3])
  names(v)<-c("PC1","PC2","PC3")
  names(v)<-c("PC1","PC2","PC3")
* Then add the label (age, sex or disease status to each sample in the last column and used this data as the input for LDA  
* Then add the labels (age, sex or disease status) to each sample in the last column and used this data as the input for LDA  
           V1        V2        V3          V4
           V1        V2        V3          V4
  1  0.8641308  3.1103773 -1.2768520      adult
  1  0.8641308  3.1103773 -1.2768520      adult

Revision as of 16:57, 12 May 2012

Regression analysis of UCLA SZ data, applying LDA function

PCA analysis, plot the data in scatter plot

  • I generate PCA score (PC1-PC3)
A=read.table("10%FDR_UCLA-GA_age_methylMatrix.txt",header=TRUE,row.names=1)
B=na.omit(A)
B$STDEV=NULL
B$min_RD=NULL
B$mean_RD=NULL
pca1 <- prcomp(t(B), scale=TRUE)
summary(pca1)
v<-data.frame(pca1$x[,1],pca1$x[,2],pca1$x[,3])
names(v)<-c("PC1","PC2","PC3")
  • Then add the labels (age, sex or disease status) to each sample in the last column and used this data as the input for LDA
          V1         V2         V3          V4
1  0.8641308  3.1103773 -1.2768520       adult
2 -7.3738694 -3.7825118  2.4297650       adult
3  6.3925767  0.5246122  0.9405213 young adult
4  6.0525615  2.0565664  4.4626373 young adult