-
Notifications
You must be signed in to change notification settings - Fork 1
/
descrittiva.R
executable file
·75 lines (52 loc) · 1.94 KB
/
descrittiva.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# load(".RData")
# download.file(url = "http://cran.r-project.org/src/contrib/Archive/epicalc/epicalc_2.15.1.0.tar.gz",
# destfile = "epicalc_2.15.1.0.tar.gz")
# install.packages(pkgs="epicalc_2.15.1.0.tar.gz", type="source", repos=NULL)
# unlink("epicalc_2.15.1.0.tar.gz")
library(epicalc)
library(ggplot2)
surv<-survival
str(surv)
#use(surv)
#des()
#summ()
#table(SESSO)
summary(surv)
table(surv$`LNR CLASSE`)
table(surv$`LODDS CLASSE`)
classe_lnr<-ggplot(data=surv, aes(`LNR CLASSE`,fill=factor(`LNR CLASSE`))) +
geom_bar() +
ggtitle("Diagramma a barre: Classe LNR") +
xlab("Classe LNR") + ylab("Conteggio") +
scale_fill_discrete(name="Classe LNR") +
geom_text(stat="count",aes(label=..count..),vjust=-0.5,size=4.2)
classe_lodds<-ggplot(data=surv, aes(`LODDS CLASSE`,fill=factor(`LODDS CLASSE`))) +
geom_bar()+
ggtitle("Diagramma a barre: Classe LODDS") +
xlab("Classe LODDS") + ylab("Conteggio") +
scale_fill_discrete(name="Classe LODDS") +
geom_text(stat="count",aes(label=..count..),vjust=-0.5,size=4.2)
eta<-ggplot(data=surv, aes(`ETA'`)) +
geom_histogram(bins=20,fill = "red",colour="black") +
labs(title="Diagramma a barre: età",x="Classe età", y="Conteggio")
shapiro.test(surv$`ETA'`)
sesso<-ggplot(data=surv, aes(`SESSO`,fill=factor(`SESSO`))) +
geom_bar() +
labs(title="Diagramma a barre: sesso",x="Sesso", y="Conteggio")
morto<-ggplot(data=surv, aes(`Morto`,fill=factor(`Morto`))) +
geom_bar() +
labs(title="Diagramma a barre: morti",x="Decesso", y="Conteggio")
malato<-ggplot(data=surv, aes(`Malattia`,fill=factor(`Malattia`))) +
geom_bar() +
labs(title="Diagramma a barre: morti",x="Ha avuto una ricaduta", y="Conteggio")
barlines <- "#1F3552"
overall_surv<-ggplot(data=surv, aes(`OVERALL SURVIVAL (mesi)`,fill=as.factor(Morto))) +
geom_histogram(bins=20,colour = barlines) +
labs(title="Sopravvivenza totale",x="Mesi", y="Conteggio")
sesso
eta
morto
malato
classe_lnr
classe_lodds
# overall_surv