Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Caso 1 19198

Pablo Palacios, Paulina Perez, Reynaldo Gaspar, Alejandro Corzo

2023-02-22
library(readr)
library(datasets)

heart = read.csv("C:\\Users\\pabla\\OneDrive\\Escritorio\\Documentos R\\


hearthDisease (1).csv")

View(heart)

## El data set cuenta con un total de 302 obs y 15 variables.

cat("Tabla de frequencia")

## Tabla de frequencia

t1 = table(heart$age)
t2 = table(heart$cp)
t3 = table(heart$fbs)
t4 = table(heart$chol)
t5 = table(heart$target)

d3 = dim(t3)

p1 = plot(t1)
p2 = plot(t2)

p3 = plot(t3)
p4 = plot(t4)

p5 = plot(t5)
h1 = hist(t1, col = "blue", breaks = 5, main = "Hist SL")

h4 = hist(t4, col = "yellow", breaks = 5, main = "Hist SL")


bp1 = boxplot(t1, col = "blue", main = "Fasting blood sugar")

bp2 = boxplot(t2, col = "green", main = "Fasting blood sugar")


bp4 = boxplot(t4, col = "yellow", main = "Fasting blood sugar")

summary(heart)
## X age sex cp
## Min. : 1.0 Min. :29.00 Min. :0.0000 Min. :0.0000
## 1st Qu.: 86.5 1st Qu.:48.00 1st Qu.:0.0000 1st Qu.:0.0000
## Median :190.5 Median :55.50 Median :1.0000 Median :1.0000
## Mean :237.3 Mean :54.42 Mean :0.6821 Mean :0.9636
## 3rd Qu.:343.8 3rd Qu.:61.00 3rd Qu.:1.0000 3rd Qu.:2.0000
## Max. :879.0 Max. :77.00 Max. :1.0000 Max. :3.0000
## trestbps chol fbs restecg
## Min. : 94.0 Min. :126.0 Min. :0.000 Min. :0.0000
## 1st Qu.:120.0 1st Qu.:211.0 1st Qu.:0.000 1st Qu.:0.0000
## Median :130.0 Median :240.5 Median :0.000 Median :1.0000
## Mean :131.6 Mean :246.5 Mean :0.149 Mean :0.5265
## 3rd Qu.:140.0 3rd Qu.:274.8 3rd Qu.:0.000 3rd Qu.:1.0000
## Max. :200.0 Max. :564.0 Max. :1.000 Max. :2.0000
## thalach exang oldpeak slope
## Min. : 71.0 Min. :0.0000 Min. :0.000 Min. :0.000
## 1st Qu.:133.2 1st Qu.:0.0000 1st Qu.:0.000 1st Qu.:1.000
## Median :152.5 Median :0.0000 Median :0.800 Median :1.000
## Mean :149.6 Mean :0.3278 Mean :1.043 Mean :1.397
## 3rd Qu.:166.0 3rd Qu.:1.0000 3rd Qu.:1.600 3rd Qu.:2.000
## Max. :202.0 Max. :1.0000 Max. :6.200 Max. :2.000
## ca thal target
## Min. :0.0000 Min. :0.000 Min. :0.000
## 1st Qu.:0.0000 1st Qu.:2.000 1st Qu.:0.000
## Median :0.0000 Median :2.000 Median :1.000
## Mean :0.7185 Mean :2.315 Mean :0.543
## 3rd Qu.:1.0000 3rd Qu.:3.000 3rd Qu.:1.000
## Max. :4.0000 Max. :3.000 Max. :1.000

#plot(t2, main = "Chest Pain type")


#boxplot(d3, col = "grey", main = "Fasting blood sugar")
#hist(t4, col = "blue", breaks = 10, main = "Hist SL")
#plot(t5)

#prop.table(t5)

You might also like