Reading the data

df <- read.csv("Impact AU.csv")
dim(df)
## [1] 149  21

Column Name

colnames(df)
##  [1] "Gender"           "Age"              "Experience"       "Qualification"   
##  [5] "Computer"         "Laptop"           "headache"         "eye.problem"     
##  [9] "back.pain"        "Facebook"         "Viper"            "WhatsApp"        
## [13] "Internet.surfing" "office.package"   "SPSS"             "Mendeley"        
## [17] "Zoom"             "Teams"            "Skype"            "Subject1"        
## [21] "Subject2"

Analysis for Section D

Give the summary of the following with the help of summary() and boxplot:

Summary of Achievement score of subject 1

attach(df)
# Achievement score of subject 1
summary(Subject1)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   30.00   45.00   60.00   72.25   71.00 2076.00

BoxPlot for Achievement score of subject 1

boxplot(Subject1)

Summary of Achievement score of subject 2

attach(df)
## The following objects are masked from df (pos = 3):
## 
##     Age, back.pain, Computer, Experience, eye.problem, Facebook,
##     Gender, headache, Internet.surfing, Laptop, Mendeley,
##     office.package, Qualification, Skype, SPSS, Subject1, Subject2,
##     Teams, Viper, WhatsApp, Zoom
# Achievement score of subject 1
summary(Subject2)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   13.00   45.00   60.00   72.32   75.00 2076.00

BoxPlot for Achievement score of subject 2

boxplot(Subject2)

Find the correlation between the achievement score of subject 1 and subject 2.

cor.test(Subject1,Subject2)
## 
##  Pearson's product-moment correlation
## 
## data:  Subject1 and Subject2
## t = 172.12, df = 147, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.9965827 0.9982125
## sample estimates:
##       cor 
## 0.9975283

8. List the variables which contains the missing values. Using if-else statement, if the variables contains the missing values then print the statement “variable contains missing values” else print “variable doesn’t contains missing values”.

## variables in the data frames
columnNames <- colnames(df)

for (i in 1:length(columnNames)) {
  
print(paste0("Checking NAs For ",columnNames[i]))
print(ifelse(anyNA(df[,i]) == "TRUE","variable contains missing values","variable doesn’t contains missing values" ))
}
## [1] "Checking NAs For Gender"
## [1] "variable doesn’t contains missing values"
## [1] "Checking NAs For Age"
## [1] "variable contains missing values"
## [1] "Checking NAs For Experience"
## [1] "variable doesn’t contains missing values"
## [1] "Checking NAs For Qualification"
## [1] "variable doesn’t contains missing values"
## [1] "Checking NAs For Computer"
## [1] "variable doesn’t contains missing values"
## [1] "Checking NAs For Laptop"
## [1] "variable doesn’t contains missing values"
## [1] "Checking NAs For headache"
## [1] "variable doesn’t contains missing values"
## [1] "Checking NAs For eye.problem"
## [1] "variable doesn’t contains missing values"
## [1] "Checking NAs For back.pain"
## [1] "variable doesn’t contains missing values"
## [1] "Checking NAs For Facebook"
## [1] "variable doesn’t contains missing values"
## [1] "Checking NAs For Viper"
## [1] "variable doesn’t contains missing values"
## [1] "Checking NAs For WhatsApp"
## [1] "variable doesn’t contains missing values"
## [1] "Checking NAs For Internet.surfing"
## [1] "variable doesn’t contains missing values"
## [1] "Checking NAs For office.package"
## [1] "variable doesn’t contains missing values"
## [1] "Checking NAs For SPSS"
## [1] "variable doesn’t contains missing values"
## [1] "Checking NAs For Mendeley"
## [1] "variable doesn’t contains missing values"
## [1] "Checking NAs For Zoom"
## [1] "variable doesn’t contains missing values"
## [1] "Checking NAs For Teams"
## [1] "variable doesn’t contains missing values"
## [1] "Checking NAs For Skype"
## [1] "variable doesn’t contains missing values"
## [1] "Checking NAs For Subject1"
## [1] "variable doesn’t contains missing values"
## [1] "Checking NAs For Subject2"
## [1] "variable doesn’t contains missing values"

Draw pie chart for varoious uses of techonology.

for (i in 5:19) {

# creating table of counts
tab <- table(df[,i])
# saving table as dataframe
tab.df <- as.data.frame(tab)
# storing counts into a variable x
x <- tab.df$Freq
# defining the lables
labels <- unique(df[,i])
piepercent<- round(100*x/sum(x), 1)
# Plot the chart.
pie(x, labels = piepercent, main = paste0(columnNames[i]," pie chart"),col = rainbow(length(x)))
legend("topright", labels, cex = 0.8,
   fill = rainbow(length(x)))

}

Draw the boxplot for the two achievement score of subject 1 and subject 2.

BoxPlot for Achievement score of subject 1

boxplot(Subject1)

BoxPlot for Achievement score of subject 2

boxplot(Subject2)