Questions 1 & 2

Using the Excel sheet, “Q 1 & 2,” compute the central tendency, variances and standard deviations for each set of scores.

score1 <-c(3,7,5,4,5,6,7,8,6,5)
score2 <-c(34, 54,17,26,34,25,14,24,25,23)
score3 <-c(154,167,132,145, 154, 145, 113, 156, 154,123)

Score 1 Summary:

summary(score1)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    3.00    5.00    5.50    5.60    6.75    8.00
library(pastecs)
stat.desc(score1)
##      nbr.val     nbr.null       nbr.na          min          max        range 
##   10.0000000    0.0000000    0.0000000    3.0000000    8.0000000    5.0000000 
##          sum       median         mean      SE.mean CI.mean.0.95          var 
##   56.0000000    5.5000000    5.6000000    0.4760952    1.0770022    2.2666667 
##      std.dev     coef.var 
##    1.5055453    0.2688474
library(psych)
describe(score1)
library(modeest)
## Registered S3 method overwritten by 'rmutil':
##   method         from 
##   plot.residuals psych
mode1 = mfv(score1)
print(mode1)
## [1] 5

In Summary, for Score 1, we have the mean = 5.6, median = 5.5, mode = 5, SD = 1.5055, and Var = 2.26

Score 2 Summary:

summary(score2)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   14.00   23.25   25.00   27.60   32.00   54.00
library(pastecs)
stat.desc(score2)
##      nbr.val     nbr.null       nbr.na          min          max        range 
##   10.0000000    0.0000000    0.0000000   14.0000000   54.0000000   40.0000000 
##          sum       median         mean      SE.mean CI.mean.0.95          var 
##  276.0000000   25.0000000   27.6000000    3.5377331    8.0029083  125.1555556 
##      std.dev     coef.var 
##   11.1872944    0.4053368
library(psych)
describe(score2)
library(modeest)
mode2 = mfv(score2)
print(mode2)
## [1] 25 34

In Summary, for Score 2, we have the mean = 27.6, median = 25, mode = 25,34, SD = 11.187, and Var = 125.156

Score 3 Summary:

summary(score3)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   113.0   135.2   149.5   144.3   154.0   167.0
library(pastecs)
stat.desc(score3)
##      nbr.val     nbr.null       nbr.na          min          max        range 
##   10.0000000    0.0000000    0.0000000  113.0000000  167.0000000   54.0000000 
##          sum       median         mean      SE.mean CI.mean.0.95          var 
## 1443.0000000  149.5000000  144.3000000    5.2916076   11.9704481  280.0111111 
##      std.dev     coef.var 
##   16.7335325    0.1159635
library(psych)
describe(score3)
library(modeest)
mode3 = mfv(score3)
print(mode3)
## [1] 154

In Summary, for Score 3, we have the mean = 144.3, median = 149.5, mode = 154, SD = 16.73, and Var = 280.01

Question 3

The Excel sheet, “test anxiety,” presents the sample data about text anxiety of the 1st year college student. Identify its mean, median, mode, variance, and standard deviation.

testanxiety <-c(85,76,93,67,82,62,56,43,91,75,87)
summary(testanxiety)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   43.00   64.50   76.00   74.27   86.00   93.00
library(pastecs)
stat.desc(testanxiety)
##      nbr.val     nbr.null       nbr.na          min          max        range 
##   11.0000000    0.0000000    0.0000000   43.0000000   93.0000000   50.0000000 
##          sum       median         mean      SE.mean CI.mean.0.95          var 
##  817.0000000   76.0000000   74.2727273    4.7541196   10.5928385  248.6181818 
##      std.dev     coef.var 
##   15.7676308    0.2122937
library(psych)
describe(testanxiety)
library(modeest)
mode4 = mfv(testanxiety)
print(mode4)
##  [1] 43 56 62 67 75 76 82 85 87 91 93

In Summary, for Test Anxiety, we have the mean = 74.27, median = 76, mode = N/A, SD = 15.77, and Var = 248.62

Question 4

4. Using the Excel sheet, “Comp Score,” create a frequency distribution, and then tell me its skewness.

CompScores<-c(12 ,15, 11, 16, 21, 25, 21,  8 , 6,  2, 22, 26, 27, 36, 34, 33, 38, 42, 44, 47, 54, 55, 51, 56, 53, 57, 49, 45, 45, 47, 43, 31, 12, 14, 15, 16, 22, 29, 29, 54, 56, 57, 59, 54, 56, 43, 44, 41, 42,  7)
print(CompScores)
##  [1] 12 15 11 16 21 25 21  8  6  2 22 26 27 36 34 33 38 42 44 47 54 55 51 56 53
## [26] 57 49 45 45 47 43 31 12 14 15 16 22 29 29 54 56 57 59 54 56 43 44 41 42  7
library(pastecs)
stat.desc(CompScores)
##      nbr.val     nbr.null       nbr.na          min          max        range 
##   50.0000000    0.0000000    0.0000000    2.0000000   59.0000000   57.0000000 
##          sum       median         mean      SE.mean CI.mean.0.95          var 
## 1722.0000000   37.0000000   34.4400000    2.4024070    4.8278175  288.5779592 
##      std.dev     coef.var 
##   16.9875825    0.4932515
library(psych)
describe(CompScores)
hist(CompScores, breaks=12, col="orange")

x <- CompScores
h<-hist(x, breaks=10, col="red", xlab="Comp Scores for Exams",
   main="Histogram of Comp Scores with Curve")
xfit<-seq(min(x),max(x),length=40)
yfit<-dnorm(xfit,mean=mean(x),sd=sd(x))
yfit <- yfit*diff(h$mids[1:2])*length(x)

lines(xfit, yfit, col="blue", lwd=2)