PhysicalActivityandStrokeOu.../1 PA Decline/data_set.R

50 lines
1.5 KiB
R
Raw Normal View History

2022-09-28 16:03:58 +02:00
## ItMLiHS assignment data set
export<-read.csv("/Volumes/Data 1/exercise/source/background.csv",colClasses = "character", na.strings = c("NA","","unknown"))
2022-09-28 16:03:58 +02:00
export<-export[,c("pase_0",
"age",
"sex",
"civil",
"smoke_ever",
"smoker",
"rtreat",
"alc",
"afli",
"hypertension",
"diabetes",
"mrs_0",
"nihss_c",
"thrombolysis",
"pad",
"thrombechtomy",
"ami",
"tci",
"pase_6",
"mrs_1",
"mfi_gen_1",
"mfi_phys_1",
"mfi_act_1",
"mfi_mot_1",
"mfi_men_1",
"mdi_1",
"who5_score_1")]
export$diabetes[is.na(export$diabetes)]<-"no"
export$diabetes[is.na(export$hypertension)]<-"no"
export$thrombolysis[is.na(export$thrombolysis)]<-"no"
export$thrombechtomy[is.na(export$thrombechtomy)]<-"no"
export$pad[is.na(export$pad)]<-"no"
export$ami[is.na(export$ami)]<-"no"
# export$smoker_prev <- ifelse(export$smoker=="3","yes","no")
export$smoker <- ifelse(export$smoker=="1","yes","no")
export$smoker[is.na(export$smoker)] <- "no"
# export$mrs_0[export$mrs_0==3]<-NA
# export<-na.omit(export)
export
# write.csv(export,"/Users/au301842/Library/CloudStorage/OneDrive-Personligt/Research/ISLcourse/assigndata.csv",row.names = FALSE)