uses MASS, Lattice
How we start to analyze the data is a large part determined by the Covariance , Correlations and Distances and Multivariate Normal Density Function. Gathering data of interest. Collecting observations of data for emperical inferential research.
hypo <-
structure(list(individual = 1:10, sex = structure(c(2L, 2L, 2L,
2L, 2L, 1L, 1L, 1L, 1L, 1L), .Label = c("Female", "Male"), class = "factor"),
age = c(21L, 43L, 22L, 86L, 60L, 16L, NA, 43L, 22L, 80L),
IQ = c(120L, NA, 135L, 150L, 92L, 130L, 150L, NA, 84L, 70L),
depression = structure(c(2L, 1L, 1L, 1L, 2L, 2L, 2L, 2L,
1L, 1L), .Label = c("No", "Yes"), class = "factor"), health = structure(c(3L,
3L, 1L, 4L, 2L, 2L, 3L, 1L, 1L, 2L), .Label = c("Average",
"Good", "Very good", "Very poor"), class = "factor"), weight = c(150L,
160L, 135L, 140L, 110L, 110L, 120L, 120L, 105L, 100L)), .Names = c("individual",
"sex", "age", "IQ", "depression", "health", "weight"), class = "data.frame", row.names = c(NA, -10L))
# take a look
hypo
## individual sex age IQ depression health weight
## 1 1 Male 21 120 Yes Very good 150
## 2 2 Male 43 NA No Very good 160
## 3 3 Male 22 135 No Average 135
## 4 4 Male 86 150 No Very poor 140
## 5 5 Male 60 92 Yes Good 110
## 6 6 Female 16 130 Yes Good 110
## 7 7 Female NA 150 Yes Very good 120
## 8 8 Female 43 NA Yes Average 120
## 9 9 Female 22 84 No Average 105
## 10 10 Female 80 70 No Good 100
str(hypo)
## 'data.frame': 10 obs. of 7 variables:
## $ individual: int 1 2 3 4 5 6 7 8 9 10
## $ sex : Factor w/ 2 levels "Female","Male": 2 2 2 2 2 1 1 1 1 1
## $ age : int 21 43 22 86 60 16 NA 43 22 80
## $ IQ : int 120 NA 135 150 92 130 150 NA 84 70
## $ depression: Factor w/ 2 levels "No","Yes": 2 1 1 1 2 2 2 2 1 1
## $ health : Factor w/ 4 levels "Average","Good",..: 3 3 1 4 2 2 3 1 1 2
## $ weight : int 150 160 135 140 110 110 120 120 105 100
Age, IQ and Weight are the only numeric data ,everything else are factors.