Skip to content

Commit c87a580

Browse files
Create Creating crea.select
1 parent d5d0158 commit c87a580

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Creating crea.select

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#To create crea.select, a subset of crea.rep used for feature selection:
2+
3+
load("crea.repvx.rda")
4+
5+
crea.select<-crea.rep[!crea.rep$EstPregnant==1&!crea.rep$RRT==1&!crea.rep$Transplant==1&crea.rep$Prehf==0,]
6+
7+
#Exclude maternity tests, data from RRT, transplant and pre heart failure patients.
8+
9+
crea.select<-crea.select[,c(x:y,z....)]
10+
11+
#Use column positions to omit all columns referencing future metrics (*_6M,Dead,Max*)
12+
#Also remove unecessary columns now redundant (EstPregnant, RRT, RRTDate,Transplant,EntryDate if event.date is retained)
13+
14+
summary(crea.select)
15+
#Note which columns should enter clustering as factors not as continuous variables. This includes categorical drugs columns.
16+
#Reclassify as a group based on position:
17+
18+
for(i in c(x,y:ncol(crea.select))) {
19+
crea.select[,i] <- as.factor(crea.rep[,i]) #Replace x and y with the numeric range of the columns being altered
20+
21+
save(crea.select,file="crea.select.rda")

0 commit comments

Comments
 (0)