In: Statistics and Probability
The following data give the weight (in kg) of all six employees of a company.
61 |
73 |
53 |
48 |
68 |
89 |
[3 marks]
[10 marks]
[4 marks]
[4 marks]
We'll answer this question using R Studio.
Since the data is weight (in kg) of employee, the variable is continuous. We will consider the distribution to be Normal with mean mu and variance sigma2.
Let X : weight of employee in kgs
a]
Using Maximum Likelihood Estimator,
mu = μ =
sigma2 = σ2 =
Code :
>w = c(61,73,53,48,68,89)
>mu = mean(w)
>mu
[1] 65.33333
>sigma2 = var(w)
>sigma2
[1] 219.4667
b]
Code :
library("utils")
samples = combn(w,4)
samples
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12]
[,13] [,14] [,15]
[1,] 61 61 61 61 61 61 61 61 61 61 73 73 73 73 53
[2,] 73 73 73 73 73 73 53 53 53 48 53 53 53 48 48
[3,] 53 53 53 48 48 68 48 48 68 68 48 48 68 68 68
[4,] 48 68 89 68 89 89 68 89 89 89 68 89 89 89 89
# each column of 'samples' is a required
sample
c]
Code :
# let us create a vector which will hold means of all
samples
>means = c()
>for(i in 1:choose(6,4)){ means[i] = mean(samples[,i])}
>means
[1] 58.75 63.75 69.00 62.50 67.75 72.75 57.50 62.75 67.75 66.50
60.50 65.75 70.75 69.50 64.50
# means is a vector of Xbar for each sample
d]
Code :
# We need to find sampling distribution of Xbar
>Xbar_mean = mean(means)
>Xbar_mean
[1] 65.33333
>Xbar_variance = var(means)
>Xbar_variance
[1] 19.59524
Xbar follows Normal distribution with mean 65.33333 and variance 19.59524
e]
Sampling error is given by the following formula
Sampling Error = Z * sigma / (√n)
where,
Z = Z score according to confidence level , here let's take 95% of confidence level, which means (0.025, 0.975)th quantiles of Normal( 0 , 1 )
sigma = population standard deviation
n = sample size chosen.
Code :
>z_val = round(qnorm(0.975,0,1),2) # rounded off the values
upto 2 decimal places
>z_val
[1] 1.96
>sigma = sqrt(sigma)
>sigma
[1] 14.81441
>n = 4
>samp_err = z_val * sigma / sqrt(n)
>samp_err
[1] 14.51812
Thus, sampling error = 14.51812