Sie sind auf Seite 1von 1

setwd("C:/Users/LAB 2/Desktop/rr")

data<-read.csv("toyota.csv",dec=".",sep=";",header=TRUE)
head(data)
dim(data)
str(data)
data$colormetalico<-as.factor(data$colormetalico)
data$automatico<-as.factor(data$automatico)
str(data)
plot(precio~edad,data=data)
plot(precio~KM,data=data)
plot(precio~HP,data=data)
plot(precio~tipocombustible,data=data,col="blue")
#######################################
library(ggplot2)
ggplot(data, aes(x =edad, y =precio))+
geom_point(aes(color =tipocombustible, shape =tipocombustible))
#####################################################################
ggplot(data, aes(x =KM, y =precio))+
geom_point(aes(color =tipocombustible, shape =tipocombustible))
#################################################################
ggplot(data, aes(x =HP, y =precio))+
geom_point(aes(color =tipocombustible, shape =tipocombustible))
install.packages("ggpubr")
library(ggpubr)
comparacion <- list(
c("CNG", "Diesel"), c("CNG", "Petrol"),
c("Petrol", "Diesel"))
###############
ggboxplot(data, x = "tipocombustible", y = "precio",
color = "tipocombustible", palette = c("#00AFBB", "#E7B800", "#FC4E07"),
add = "jitter")+
stat_compare_means(comparisons = comparacion,method = "t.test")
########################################################
prop.table(table(data$tipocombustible))
m<-lm(precio~.,data=data)
summary(m)
############################################################################

Das könnte Ihnen auch gefallen