Problem #1
library(IPSUR)
require(IPSUR)
require(psych)
## Loading required package: psych
require(MASS)
## Loading required package: MASS
require(car)
## Loading required package: car
## Loading required package: carData
##
## Attaching package: 'car'
## The following object is masked from 'package:psych':
##
## logit
require(data.tree)
## Loading required package: data.tree
summary(iris)
## Sepal.Length Sepal.Width Petal.Length Petal.Width
## Min. :4.300 Min. :2.000 Min. :1.000 Min. :0.100
## 1st Qu.:5.100 1st Qu.:2.800 1st Qu.:1.600 1st Qu.:0.300
## Median :5.800 Median :3.000 Median :4.350 Median :1.300
## Mean :5.843 Mean :3.057 Mean :3.758 Mean :1.199
## 3rd Qu.:6.400 3rd Qu.:3.300 3rd Qu.:5.100 3rd Qu.:1.800
## Max. :7.900 Max. :4.400 Max. :6.900 Max. :2.500
## Species
## setosa :50
## versicolor:50
## virginica :50
##
##
##
#Problem
#A) How Many Cases were included in the data?
dim(iris)
## [1] 150 5
#[1] 150 5 <- implies there are 150 cases
#B) How many numerical variables are included in the data? Indicate what they are, and if they are continuous or discrete
colnames(iris)
## [1] "Sepal.Length" "Sepal.Width" "Petal.Length" "Petal.Width"
## [5] "Species"
#there are four numerical variables:
#"Sepal.Length" "Sepal.Width"
# "Petal.Length" "Petal.Width"
#each of the variables are continuous as they are measurements of length and width
#C) How many categorical variables are included in the data, and what are they? list the corresponding levels
#There is one categorical variable: Species
summary(iris$Species)
## setosa versicolor virginica
## 50 50 50
#setosa versicolor virginica
# 50 50 50
fivenum(iris$Sepal.Length)
## [1] 4.3 5.1 5.8 6.4 7.9
#[1] 4.3 5.1 5.8 6.4 7.9
fivenum(iris$Sepal.Width)
## [1] 2.0 2.8 3.0 3.3 4.4
#[1] 2.0 2.8 3.0 3.3 4.4
fivenum(iris$Petal.Length)
## [1] 1.00 1.60 4.35 5.10 6.90
#[1] 1.00 1.60 4.35 5.10 6.90
fivenum(iris$Petal.Width)
## [1] 0.1 0.3 1.3 1.8 2.5
#[1] 0.1 0.3 1.3 1.8 2.5