Question

In: Statistics and Probability

Please solve it by R (1) Find the mean and variance of the variable of ’volume’...

Please solve it by R

(1) Find the mean and variance of the variable of ’volume’ in ’lung’ dataset in package ’ISwR’.

(2) Check the normality of the variable of ’volume’ in ’lung’ dataset in package ’ISwR’ with significance level α = 0.1.

(3) Test if the mean of ’volume’ is less than 3.3 with significance level α = 0.05.

Solutions

Expert Solution

Please find attached R codes. Just copy the commands in R script and run the program by pressing Ctrl+R.

If using R studio then press Ctrl+Enter.

Codes also include installing ISwR package.

install.packages("ISwR") library("ISwR", lib.loc="~/R/win-library/3.5") data=lung data$volume #to find mean and variance of volume mean(data$volume) var(data$volume) #to check normality shapiro.test(data$volume) #to check if the mean is greater than 3.3 t.test(data$volume,mu=3.3,alternative = "less")

Part 1)

Mean of volume = 3.227778

Variance of volume = 0.2409477

Part 2)

Now to check the normality of the variable volume we use the Shapiro Wilk test of normality. It tests whether the sample is coming from the Normal population or not. Following is the output of R.

Shapiro-Wilk normality test

data: data$volume
W = 0.94197, p-value = 0.3131

The P-value for the test is 0.3131.

At the 0.1 level of significance, the p-value is much higher than the level of significance.

Hence we do not have enough evidence to reject the null hypothesis.

Variable volume is coming from the normal population at 0.1 level of significance.

Part 3)

Now to check if the mean of volume is less than 3.3 with the level of significance 0.05.

We use one-sample t-test to check the hypothesis we made.

For the one-sample t-test, we need the assumption of normality to be satisfied, which we have already checked in the above part of the solution.

Null hypothesis: mean=3.3

Versus

Alternative hypothesis: mean<3.3

Hence this is a one-sided one-sample t-test.

Using the direct command in R for the t-test.

In R command the argument mu is the hypothesized value of the parameter specified under the null hypothesis.

By default R tests for both-sided alternative hypothesis but, as we want to test for single-sided hence we use another argument as "less" according to our alternative hypothesis.

#If we have an alternative hypothesis of greater than kind then we can use "greater" as an argument.

Following is the output:

One Sample t-test

data: data$volume
t = -0.62423, df = 17, p-value = 0.2704
alternative hypothesis: true mean is less than 3.3
95 percent confidence interval:
-Inf 3.429046
sample estimates:
mean of x
3.227778

The P-value for the test is 0.2704.

As the P-value is much higher than level of significance, we do not have enough evidence to reject the null hypothesis.

Hence at 0.05 level of significance, we accept that mean of 'volume' is 3.3.

Hence at 0.05 level of significance, we can say that mean of 'volume' is not less than 3.3

I have tried to explain as much as possible. I hope you find the solution helpful. Please do not forget to rate the answer.

Feel free to ask any doubts regarding the solution.


Related Solutions

A random variable X is normally distributed with a mean of 1 and variance 4. Find...
A random variable X is normally distributed with a mean of 1 and variance 4. Find a) The probability that a randomly selected score from this distribution is less than 3. a.)Sketch a normal curve and shade out the region. b) The probability that a score selected at random from this distribution lies between 2 and 5. Sketch a normal curve and shade out the region c) The probability that a score selected at random from this distribution is greater...
Use R to compute the probability that a Normal random variable with mean 0 and variance...
Use R to compute the probability that a Normal random variable with mean 0 and variance 3.7 is less than.2. Find the 93% quantile of the above random variable by using the R command and also by using the z -table.
Let the random variable X is normal with mean zero and unit variance . Find the...
Let the random variable X is normal with mean zero and unit variance . Find the values of A and B such that P(A<X<B)=0.998. A= B=
1. Let X be a random variable with mean μ and variance σ . For a...
1. Let X be a random variable with mean μ and variance σ . For a ∈ R, consider the expectation E ((X − a)2) a) Write E((X −a)2) in terms of a,μ and σ2 b) For which value a is E ((X − a)2) minimal? c) For the value a from part (b), what is E ((X − a)2)? 2. Suppose I have a group containing the following first- and second-year university students from various countries. The first 3...
Given the normally distributed random variable X with mean 18 and variance 6.25, find (a) P(16...
Given the normally distributed random variable X with mean 18 and variance 6.25, find (a) P(16 < X < 22). (b) the value of k1 such that P(X < k1) = 0.2946 (c) the value of k2 such that P(X > k2) = 0.8186 (d) the two cut-off values that contain the middle 90% of the normal curve area
1) For your sample, use R to find the mean of x, the mean of y,...
1) For your sample, use R to find the mean of x, the mean of y, the standard deviation of x, the standard deviation of y, and the correlation between x and y. (You must give R code for credit.) > set.seed(0003653838) > x=rnorm(500) > y=2*x+rnorm(500) > Xbar=mean(x) > Xbar [1] 0.0712552 > Ybar=mean(y) > Ybar [1] 0.2370446 > sdx=sd(x) > sdx [1] 0.9841084 > sdy=sd(y) > sdy [1] 2.277837 > corxy=cor(x,y) > corxy [1] 0.9040743 2) Find the equation...
Question 1 The production-volume variance is a component of the sales-volume variance. True False Question 2...
Question 1 The production-volume variance is a component of the sales-volume variance. True False Question 2 Long-run planning and short-run planning are best performed in combination with each other. True False Question 3 Managers can always view a favorable variable overhead spending variance as desirable. True False Question 4 Direct material price variance is likely to be unfavorable if the purchasing manager switched to a lower-price supplier. True False Question 5 Managers must not interpret variances in isolation of each...
Find the mean and the Variance of the following sample data:             x Frequency (f) 1...
Find the mean and the Variance of the following sample data:             x Frequency (f) 1 5 2 6 4 9 8 6 12 4
X is a Gaussian random variable with variance 9. It is known that the mean of...
X is a Gaussian random variable with variance 9. It is known that the mean of X is positive. It is also known that the probability P[X^2 > a] (using the standard Q-function notation) is given by P[X^2 > a] = Q(5) + Q(3). (a) [13 pts] Find the values of a and the mean of X (b) [12 pts] Find the probability P[X^4 -6X^2 > 27]
What does a positive and negative fixed overhead budget variance and fixed overhead volume variance mean?...
What does a positive and negative fixed overhead budget variance and fixed overhead volume variance mean? In the answer, ensure to go beyond stating that it is favourable or unfavourable.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT