library("car")
## Loading required package: carData
library('DATA606')
## Loading required package: shiny
## Loading required package: openintro
## Please visit openintro.org for free statistics materials
##
## Attaching package: 'openintro'
## The following object is masked from 'package:car':
##
## densityPlot
## The following objects are masked from 'package:datasets':
##
## cars, trees
## Loading required package: OIdata
## Loading required package: RCurl
## Loading required package: bitops
## Loading required package: maps
## Loading required package: ggplot2
##
## Attaching package: 'ggplot2'
## The following object is masked from 'package:openintro':
##
## diamonds
## Loading required package: markdown
##
## Welcome to CUNY DATA606 Statistics and Probability for Data Analytics
## This package is designed to support this course. The text book used
## is OpenIntro Statistics, 3rd Edition. You can read this by typing
## vignette('os3') or visit www.OpenIntro.org.
##
## The getLabs() function will return a list of the labs available.
##
## The demo(package='DATA606') will list the demos that are available.
##
## Attaching package: 'DATA606'
## The following object is masked from 'package:utils':
##
## demo
startLab('Lab2')
## Setting working directory to C:/Users/jey19/Documents/R/win-library/3.6/DATA606/labs/Lab2
## [1] "C:/MSDS/Semester 1/DATA 606 Statistics and Probablity/Labs/Week2/Lab2/jey19-intro_to_data.Rmd"
source("more/cdc.R")
The two variables in this example are Desired Weight and Actual Weight. The relationship is actually the weight a person wants to maintain and the actual weight he weighs currently.
There could be three values for the wdiff, 0 means the person is not deviated from his desired weight goal, Positive difference means the person is underweight and Negative difference means the person is overweight. In General most people feel they are ideal but some people feel they are overweight comparing to the ones who feel underweight.
m_dataset <- subset(cdc,gender == “m”) f_dataset <- subset(cdc,gender == “f”)
wdiff_m <- m_dataset\(wtdesire - m_dataset\)weight wdiff_f <- f_dataset\(wtdesire - f_dataset\)weight
summary(wdiff_m) summary(wdiff_f)
boxplot(mean(wdiff_m) ~ mean(wdiff_f))
Men feel they are maintaining ideal weight comparing to women.
```