0% found this document useful (0 votes)
7 views4 pages

Hair and Eye Color Analysis Report

The document describes an analysis of seed germination data from an experiment with covered and uncovered boxes with varying water levels. It finds that: - For covered boxes, germination increases from water levels 1-3 and decreases from 3-5, with no germination at level 6. - For uncovered boxes, germination increases from levels 1-4 and decreases at level 5, with no germination at level 6. - Germination levels are nearly equal between covered and uncovered boxes.

Uploaded by

roliho3769
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views4 pages

Hair and Eye Color Analysis Report

The document describes an analysis of seed germination data from an experiment with covered and uncovered boxes with varying water levels. It finds that: - For covered boxes, germination increases from water levels 1-3 and decreases from 3-5, with no germination at level 6. - For uncovered boxes, germination increases from levels 1-4 and decreases at level 5, with no germination at level 6. - Germination levels are nearly equal between covered and uncovered boxes.

Uploaded by

roliho3769
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Lab_Assignment-1

Download an external file(hair_eye_color.csv)


df<-[Link]("D:/VIT/SY/DS/LAB/hair_eye_color.csv")
head(df)

## [Link]. [Link] [Link]


## 1 1 Blonde Blue
## 2 2 Blonde Blue
## 3 3 Blonde Green
## 4 4 Blonde Brown
## 5 5 Blonde Brown
## 6 6 Blonde Black

summary(df)

## [Link]. [Link] [Link]


## Min. : 1.00 Length:20 Length:20
## 1st Qu.: 5.75 Class :character Class :character
## Median :10.50 Mode :character Mode :character
## Mean :10.50
## 3rd Qu.:15.25
## Max. :20.00

Q1) How many people have Brown eye color?


nrow(subset(df,df$[Link]=="Brown"))

## [1] 10

How many people have Blonde hair?


nrow(subset(df,df$[Link]=="Blonde"))

## [1] 6

How many Brown haired people have Black eyes?


nrow(df[df$[Link]=="Brown"& df$[Link]=="Black",])

## [1] 2

What is the percentage of people with Green eyes?


c<-nrow(subset(df,df$[Link]=="Green"))
(c/length(df$[Link]))*100

## [1] 10
What percentage of people have red hair and Blue eyes?
nrow(df[df$[Link] == "Red" & df$[Link] == "Blue", ]) * 100 / nrow(df)

## [1] 5
Q2

df1<[Link]("D:/VIT/SY/DS/LAB/
## 3 Uncovered 1 27
[Link]")
## 4 Uncovered 1 23
head(df1)
## 5 Uncovered 2 41
#### 6 Uncovered 2
Box water_amt 46
## 1 Uncovered122
germinated
##summary(df1)
2 Uncovered125
## Box water_amt germinated
## Length:48 Min. :1.0 Min. : 0.00
## Class :character 1st Qu.:2.0 1st Qu.:30.00
## Mode :character Median :3.5 Median :48.50
## Mean :3.5 Mean :47.62
## 3rd Qu.:5.0 3rd Qu.:73.00
## Max. :6.0 Max. :84.00

What is the average number of seeds germinated for the uncovered boxes with level of
watering equal to 4?
mean(subset(df1$germinated,df1$Box=="Uncovered" & df1$water_amt==4))

## [1] 78

What is the median value for the data covered boxes?


median(subset(df1$germinated,df1$Box=="Covered"))

## [1] 45

Establish conclusions on the o available data: a. Association of levels of watering with the
number of germinating seeds in case Of covered boxes as well as uncovered boxes.
mean(subset(df1$germinated,df1$Box=="Covered" & df1$water_amt==1))

## [1] 42.75

mean(subset(df1$germinated,df1$Box=="Covered" & df1$water_amt==2))

## [1] 75.25

mean(subset(df1$germinated,df1$Box=="Covered" & df1$water_amt==3))

## [1] 76

mean(subset(df1$germinated,df1$Box=="Covered" & df1$water_amt==4))

## [1] 52
mean(subset(df1$germinated,df1$Box=="Covered" & df1$water_amt==5))

## [1] 37.75

mean(subset(df1$germinated,df1$Box=="Covered" & df1$water_amt==6))

## [1] 0

Germination is increasing from water level 1-3 and decreasing 3-5 and it is 0 at water level
6
mean(subset(df1$germinated,df1$Box=="Uncovered" & df1$water_amt==1))

## [1] 24.25

mean(subset(df1$germinated,df1$Box=="Uncovered" & df1$water_amt==2))

## [1] 46

mean(subset(df1$germinated,df1$Box=="Uncovered" & df1$water_amt==3))

## [1] 66.75

mean(subset(df1$germinated,df1$Box=="Uncovered" & df1$water_amt==4))

## [1] 78

mean(subset(df1$germinated,df1$Box=="Uncovered" & df1$water_amt==5))

## [1] 72.75

mean(subset(df1$germinated,df1$Box=="Uncovered" & df1$water_amt==6))

## [1] 0

Germination is increasing from water level 1-4 and decreases at water level 5 and it is 0 at
water level 6
b)Association of number of germinating seeds with the fact that the boxes were covered or
uncovered.
mean(subset(df1$germinated,df1$Box=="Covered"))

## [1] 47.29167

mean(subset(df1$germinated,df1$Box=="Uncovered"))

## [1] 47.95833

Germination is nearly equal in both the cases.

You might also like