-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSUBTYPE1.R
More file actions
22 lines (21 loc) · 797 Bytes
/
SUBTYPE1.R
File metadata and controls
22 lines (21 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
library(survival)
library(survminer)
m<-read.table("metaunicox")
s<-read.table("scmod2subtype")
rownames(s)<-rownames(m)
y<-cbind("Others","Claudin") //important to keep the rank of sfit
y<-cbind("Basal","Her2","LumB","LumA","Normal")
y<-cbind("ER-/HER2-","ER+/HER2- High Prolif","ER+/HER2- Low Prolif","HER2+")
y<-cbind("ER-/HER2-","ER+/HER2- High Prolif","ER+/HER2- Low Prolif","HER2+")
table(s$type)
for (k in 1:ncol(y)){
kb=y[1,k]
sb<-subset(s,type==kb)
mb=m[(rownames(m)) %in% substr(gsub("\\.","-",rownames(sb)),1,12),]
sfit <- survfit(Surv(year, five)~risk, data=mb)
print(sfit)
}
data1 <- matrix(c(106,69,258,142,13,86,37,241,83,7), ncol=5, byrow=TRUE)
colnames(data1) <- c("Basal","Her2","LumB","LumA","Normal")
rownames(data1) <- c("low","high")
chisq.test(data1)