Skip to main content

Descriptive Statistics


In this week assignment i was task to compute the mean, mode, median, range, interquartile, variance, standard deviation for two set data with sample size of n=7.  from what observes the Y data have higher mean and median than the X data. the mode for both X and Y are numeric which mean both data doesn't have a mode because of the sample size. the variance of both data are the same occurrences of deviation. the quantile for Y data is much higher than X data. below is my code for the X and Y data. 


R Code 
#two sets of data
 x <- c(10, 2, 3, 2, 4, 2, 5)
y <- c(20, 12, 13, 12, 14, 12, 15)

#calculate the mean for x and y
mean(x)
  [1] 4
mean(y)
  [1] 14

#calculate the mode for x and y
mode(x)
  [1] "numeric"
mode(y)
  [1] "numeric"

#calculate the median for x and y

 median(x)
  [1] 3
 median(y)
  [1] 13

#calculate the variance for x and y
var (x)
  [1] 8.333333
var(y)
  [1] 8.333333

#calculate the standard deviation  for x and y
sd (x)
  [1] 2.886751
sd(y)
  [1] 2.886751

#calculate the quantile for x and y

quantile(x)
  0%  25%  50%  75% 100%
  2.0  2.0  3.0  4.5 10.0

quantile(y)
  0%  25%  50%  75% 100%
  12.0 12.0 13.0 14.5 20.0

  #calculate the range for x and y
  range(x)
  [1]  2 10

   range(y)
  [1] 12 20

#print out the summary(x) and summary(y)

 summary(x)
  Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
  2.0     2.0     3.0     4.0     4.5    10.0

 summary(y)
  Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
  12.0    12.0    13.0    14.0    14.5    20.0

Comments

Popular posts from this blog

Project: Building a Predictive Model

You are a data scientist working for University of South Florida. Your boss wants to develop a predictive model to automatically make a prediction on students' graduation rates based on several factors (variables). You have College dataset ( College.csv ) , which is also available in the ISLR package.  R code Studio

Information Architecture: High Fidelity Design

 For my Group  Project we had to create a low fidelity and high fidelity website design that focus on education and student as well as parents or those involves in education.     

Confidence Interval Estimation And introduction to Fundamental of hypothesis testing

1. x̄ = 85 and σ = 8, and n = 64, set up a 95% confidence interval estimate of the population mean μ.  Z= 1-(0.05/2) = 1.96 Sample mean= x-bar = 85 Z*s/sqrt(n) = (1.96*8)/sqrt(64) = 1.96 CI= 85 – 1.96= 83.04 CI= 85- 1.96= 86.96 (83.04, 86.96) 2. If  x̄ = 125, σ = 24 and n = 36, set up a 99% confidence interval estimate of the population mean μ.  Z= 1- (0.01/2) = 0.995= 2.57 Z*s/sqrt(n) = 125 - (2.57*8/sqrt(36) = 3.42-125= 121.58 Z*s/sqrt(n) = 125 + (2.57*8/sqrt(36) = 3.42+125= 128.42 3. The manager of a supply store wants to estimate the actual amount of paint contained in 1-gallon cans purchased from a nationally known manufacturer. It is known from the manufacturer's specification sheet that standard deviation of the amount of paint is equal to 0.02 gallon. A Random sample of 50 cans is selected and the sample mean amount of paint per 1 gallon is 0.99 gallon.  3a. Set up a 99% confidence inter...