****if deces: 0=death; 1 alive)*************
#Prepare: packages, data
library("foreign")
library("survival")
require("moonBook")
## Loading required package: moonBook
require("ztable")
## Loading required package: ztable
## Welcome to package ztable ver 0.2.0
require("magrittr")
## Loading required package: magrittr
options(ztable.type="html")
#read data and group for variable
data=read.csv("E:/GCSP/Jobs/A Tri/data csv.csv")
head(data)
## ID Dossier age age_code Sexe sex_code Tabagisme localisation Origin
## 1 1 983188 49 0 F 0 1 1 Kidney
## 2 2 821908 67 1 F 0 0 1 Breast
## 3 3 390270 65 1 F 0 1 1 Lung
## 4 4 938314 59 0 M 1 1 1 Prostate
## 5 5 7049669 69 1 F 0 0 1 Breast
## 6 6 7149632 56 0 M 1 1 1 Kidney
## Pathologie Apparition ASIAPreOp AmbulationPreOP fctSphincter approcheChx
## 1 Carcinoma 2 2 1 1 1
## 2 Carcinoma 1 3 1 2 3
## 3 Carcinoma 1 2 2 2 2
## 4 Carcinoma 1 2 0 2 1
## 5 Carcinoma 1 3 2 2 1
## 6 Carcinoma 2 2 2 2 3
## ScoreASA DateChx DureeChx PertesSang MedicalComplic SurgicalComplic
## 1 3 22/11/2017 278 1200 0 0
## 2 3 27/09/2017 479 700 0 0
## 3 3 28/07/2016 120 200 1 0
## 4 3 6/2/2016 115 400 0 0
## 5 3 9/10/2015 155 200 0 0
## 6 3 7/11/2014 320 1500 1 0
## WoundInfection AmbulationPO Improvement.of.ambulation PainImprovPO ASIA_PO
## 1 1 1 0 3 4
## 2 0 1 0 3 4
## 3 0 1 1 3 4
## 4 0 1 1 3 4
## 5 0 2 0 3 4
## 6 0 0 2 1 0
## Improvement.of.ASIA.score DureeSejour RoRxPreOP RoRxPO SystemicTherapyPO
## 1 1 5 0 1 1
## 2 NA 9 1 1 1
## 3 1 16 0 0 1
## 4 1 6 0 1 1
## 5 NA 5 0 1 1
## 6 2 8 0 0 0
## Tokuhashi Tokuhashi_cat Deces dateDeces dernierRV SurviePosOpMOIS
## 1 9 2 0 31/10/2019 24/05/2019 23.60
## 2 13 3 0 31/10/2019 9/2/2018 25.47
## 3 5 1 1 12/8/2017 12/8/2017 12.67
## 4 7 1 1 20/05/2016 20/05/2016 3.47
## 5 12 3 1 16/04/2016 30/11/2015 6.33
## 6 7 1 1 8/11/2014 8/11/2014 0.03
## DureeSuivi DernSuiviDeces
## 1 18.27 5.33
## 2 4.50 20.97
## 3 12.67 0.00
## 4 3.47 0.00
## 5 1.73 4.60
## 6 0.03 0.00
names(data) #name of variables
## [1] "ID" "Dossier"
## [3] "age" "age_code"
## [5] "Sexe" "sex_code"
## [7] "Tabagisme" "localisation"
## [9] "Origin" "Pathologie"
## [11] "Apparition" "ASIAPreOp"
## [13] "AmbulationPreOP" "fctSphincter"
## [15] "approcheChx" "ScoreASA"
## [17] "DateChx" "DureeChx"
## [19] "PertesSang" "MedicalComplic"
## [21] "SurgicalComplic" "WoundInfection"
## [23] "AmbulationPO" "Improvement.of.ambulation"
## [25] "PainImprovPO" "ASIA_PO"
## [27] "Improvement.of.ASIA.score" "DureeSejour"
## [29] "RoRxPreOP" "RoRxPO"
## [31] "SystemicTherapyPO" "Tokuhashi"
## [33] "Tokuhashi_cat" "Deces"
## [35] "dateDeces" "dernierRV"
## [37] "SurviePosOpMOIS" "DureeSuivi"
## [39] "DernSuiviDeces"
##explaination
###subset dataset -Independent vars:
data$MedicalComplic = factor(data$MedicalComplic)
data$SurgicalComplic = factor(data$SurgicalComplic)
data$WoundInfection = factor(data$WoundInfection)
attach(data)
mytable(localisation~MedicalComplic+SurgicalComplic+ WoundInfection,data=data) %>% deleteRows(1)
##
## Descriptive Statistics by 'localisation'
## ________________________________________________________
## 1 2 3 p
## (N=47) (N=96) (N=48)
## --------------------------------------------------------
## - 0 41 (87.2%) 85 (88.5%) 38 (79.2%)
## - 1 6 (12.8%) 11 (11.5%) 10 (20.8%)
## SurgicalComplic 0.366
## - 0 47 (100.0%) 94 (97.9%) 46 (95.8%)
## - 1 0 ( 0.0%) 2 ( 2.1%) 2 ( 4.2%)
## WoundInfection 0.844
## - 0 45 (95.7%) 92 (95.8%) 45 (93.8%)
## - 1 2 ( 4.3%) 4 ( 4.2%) 3 ( 6.2%)
## --------------------------------------------------------
#mytable(localisation+Improvement.of.ambulation~age_code+Tabagisme+ ASIAPreOp+ ASIA_PO+ Tokuhashi_cat+AmbulationPreOP+ AmbulationPO+ RoRxPO+SystemicTherapyPO+sex_code,data=a) %>% deleteRows(3)