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

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.     

Probability Theory

A. Based on Table 1 What is the probability of: B B1 A 10 20 A1 20 40 A1 . Event A A2 . Event B? A3.  Event A or B A4 . P(A or B) = P(A) + P(B) B. Applying Bayes' Theorem  Jane is getting married tomorrow, at an outdoor ceremony in the desert. In recent years, it has rained only 5 days each year. Unfortunately, the weatherman has predicted rain for tomorrow. When it actually rains, the weatherman correctly forecasts rain 90% of the time. When it doesn't rain, he incorrectly forecasts rain 10% of the time. What is the probability that it will rain on the day of Jane's wedding?  Solution: The sample space is defined by two mutually-exclusive events - it rains or it does not rain. Additionally, a third event occurs when the weatherman predicts rain. Notation for these events appears below. Event A1. It rains on Jane's wedding. Event A2. It does not rain on Marie's wedding. Event B. The weatherman predicts rain. In terms of probabilities, we know t...

Hypothesis Testing and Correlation Analysis

The director of manufacturing at a cookies needs to determine whether a new machine is production a particular type of cookies according to the manufacturer's specifications, which indicate that cookies should have a mean of 70 and standard deviation of 3.5 pounds. A sample pf 49 of cookies reveals a sample mean breaking strength of 69.1 pounds. A.  State the null and alternative hypothesis   Ho = u>=  70  and alt hypo. Ho = u<70 B.  Is there evidence that the machine is nor meeting the manufacturer's specifications for average strength? Use a 0.05 level of significance .  since the data is random sample size the data seem almost approximate normal.  C.  Compute the p value and interpret its meaning?  (xbar - mu) / (stdsqrt(n)) = (69.1 - 70)/(3.5/sqrt(49)) =  -1.80 this indicted it does not fall under the region and it is rejected.  D.   What would be your answer in (B) if the standard deviation were specified...