-
Notifications
You must be signed in to change notification settings - Fork 0
/
LinearRegresionFish.R
51 lines (43 loc) · 1.29 KB
/
LinearRegresionFish.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
########
data<-read.csv("Fish.csv",stringsAsFactors = F)
##########
unique(data$ï..Species)
dataSub<-data[data$ï..Species=="Bream",]
##########
data$ï..Species<-NULL
apply(data,2,function(x) sum(is.na(x)))
###########
library(ggplot2)
## Length 1
ggplot(data,aes(x=Length1,y=Weight))+
geom_point()+
geom_smooth(method = "lm",se=F)+
theme_classic()
#### Mozemo reci da postoji velika linearna zavisnost izmedju zavisne i nezavisne
### Length2
ggplot(data,aes(x=Length2,y=Weight))+
geom_point()+
geom_smooth(method = "lm",se=F)+
theme_classic()
#### Mozemo reci da postoji velika linearna zavisnost izmedju zavisne i nezavisne
### Length3
ggplot(data,aes(x=Length3,y=Weight))+
geom_point()+
geom_smooth(method = "lm",se=F)+
theme_classic()
#### Mozemo reci da postoji velika linearna zavisnost izmedju zavisne i nezavisne
### Height
ggplot(data,aes(x=Height,y=Weight))+
geom_point()+
geom_smooth(method = "lm",se=F)+
theme_classic()
#### Mozemo reci da postoji velika linearna zavisnost izmedju zavisne i nezavisne
### Width
ggplot(data,aes(x=Width,y=Weight))+
geom_point()+
geom_smooth(method = "lm",se=F)+
theme_classic()
#### Mozemo reci da postoji velika linearna zavisnost izmedju zavisne i nezavisne
library(corrplot)
cor_matrix<-cor(data[,c(1,5:6)])
corrplot.mixed(cor_matrix)