Mean for the number of steps:
## [1] 10749.34
Median for the number of steps:
## [1] 10919.5
Standard deviation for the number of steps
## [1] 4304.674
Mean for hours of sleep:
## [1] 7.406629
Median for hours of sleep:
## [1] 7.616667
Standard deviation for hours of sleep:
## [1] 1.462602
Q1 for distance walked in miles:
## 25%
## 3.39
Q2 for distance walked in miles:
## 50%
## 4.93
Q3 for distance walked in miles:
## 75%
## 6.0925
Q1 for distance walked in steps:
## 25%
## 7722.25
Q2 for distance walked in Steps:
## 50%
## 10919.5
Q3 for distance walked in Steps:
## 75%
## 13779.5
Five number summary for hours of sleep:
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.000 7.383 7.617 7.407 8.104 9.333
Standard deviation for distance walked in miles:
## [1] 1.913514
The typical deviation from the mean for this person in miles walked per day is 1.914 miles.
Boxplot of number of steps per day for each day of the week:
It appears that Sunday is the least active day in the week, with a median being just over 5,000 steps.
Boxplot of hours of sleep for each day of the week:
Based on the median, Saturdays allow for slightly more sleep than usual, while Mondays allow the least amount of sleep.
Histogram for overall amount of miles traveled:
The data appears to be symmetric. This is because there is no obvious tail on the histogram appears that can indicate if the histogram is skewed or not.
Q1 for hours of sleep:
## 25%
## NA
Q2 for hours of sleep:
## 50%
## NA
Q3 for hours of sleep:
## 75%
## NA
Barplot of marriage status:
Most people land in the “Married” category.
Barplot of marriage status and obesity:
There appears to be no relationship between obesity and marriage. The proportions of “married”, “divorced”, “widowed”, and “underweight” are the same for the underweight group as it is with the overweight group.
Barplot of gender vs obesity status:
According to the barplot, there is a higher frequency of males in the overweight group than females.
Barplot of gender and marriage status:
Males are more often widowed than females since the graph shows that males are more than twice as likely to be widowed.
There is a larger proportion of males in the dataset.There is a larger proportion of underwight individulas in the dataset.
Based on the mosaicplot above, there is a larger proportion of females that are underweight. There is relatively more overweight men than women.
Based on the mosaic plot, the subgroup “married” has the most people in it.
Based on the mosaicplot, there is more widowed underweight individuals than widowed overweight.
Based on the mosaicplot above, there are slightly more divored people than widowed people.
Fitbit <- read.csv("C:/Users/yasse/Downloads/Fitbit.csv")
View(Fitbit)
work <- read.csv("C:/Users/yasse/Downloads/work.csv")
View(work)
mean(Fitbit$Steps)
median(Fitbit$Steps)
sd(Fitbit$Steps)
mean(Fitbit$Sleep)
median(Fitbit$Sleep)
sd(Fitbit$Sleep)
quantile(Fitbit$Miles, .25)
quantile(Fitbit$Miles, .50)
quantile(Fitbit$Miles, .75)
quantile(Fitbit$Steps, .25)
quantile(Fitbit$Steps, .50)
quantile(Fitbit$Steps, .75)
summary(Fitbit$Sleep)
sd(Fitbit$Miles)
boxplot(Fitbit$Steps~Fitbit$Day, xlab = "Day of the Week", ylab = "Number of Steps", main = "Boxplot of Number of Steps Per Day for each Day of the Week")
boxplot(Fitbit$Sleep~Fitbit$Day, xlab = "Day of the Week", ylab = "Hours of Sleep", main = "Boxplot of Hours of Sleep for each Day of the Week")
hist(Fitbit$Miles,xlab = "Miles Traveled", ylab = "Frequency", main = "Histogram of Overall Miles Traveled")
quantile(Fitbit$hours, .25)
quantile(Fitbit$hours, .50)
quantile(Fitbit$hours, .75)
barplot(table(work$marriage),xlab = "Marriage Status", ylab = "Number of People", main = "Barplot of marriage Status")
rownames = c(names(table(work$marriage)))
barplot(table(work$marriage,work$obese),
col = rainbow(4),
legend = rownames(table(work$marriage,work$obese)),
beside = T,
xlab = "Obesity Status",
ylab = "Number of People",
main = "Barplot of Marriage Status vs Obesity")
barplot(table(work$gender,work$obese),
beside = T,
col = rainbow(2), legend = rownames(table(work$gender, work$obese)), xlab = "Obesity Status", ylab = "Number of People", main = "Barplot of Gender vs Obesity")
barplot(table(work$gender,work$marriage),beside = T, col = rainbow(2), legend = rownames(table(work$gender, work$marriage)),xlab = "Marriage Status", ylab = "Number of People", main = "Barplot of Gender vs Marriage Status")
mosaicplot(table(work$gender,work$obese),color = TRUE,xlab = "Gender", ylab = "Obesity Status", main = "Mosaicplot of Obesity Status vs Gender")
mosaicplot(table(work$marriage,work$obese),color = TRUE,xlab = "Marriage Status", ylab = "Obesity Status", main = "Mosaicplot of Marriage Status vs Gender")