Question

In: Math

This question will be perfomed entirely in R. Consider the following sample from an unkown distribution:...

This question will be perfomed entirely in R. Consider the following sample from an unkown distribution:

sample_data <- c(1.15, 0.5, 28.03 , 0.085, 1.82, 25.30, 0.7, 0.02, 0.01 ,13.23)

1.a) Calculating the p-value using the bootstrap hypothesis testing method to determine whether the mean is greater than 1 (one-sided test). Use 10,000 bootstrap samples. Set the seed to 248 before beginning the bootstrap process, i.e. include this line of code at the beginning of your script.

set.seed(248)
Include a histogram of the generated bootstrap samples of X̄⋆, does it appear to be symmetric? Do you

reject the null at 0.05 significance level? (10 points)
1.b) Find the rejection region (for X̄) based on your bootstrap samples at a 0.05 significance level. (5 points)

1.c) Perform a t-test for the same hypothesis as in 1.a) using the t.test function in R. Make sure that you apply the correct arguments.

Do you reject the null at a 0.05 significance level based on the t-test?

Compare the p-value from 1.a) to the p-value from the t-test, do they imply different conlcusion? Which p-value would you trust more? Support your anwser. (10 points)

Solutions

Expert Solution

ANSWER:

Given that,

1.a)

library(boot)
set.seed(248)
bootrapmean<-function(data,sample){
mean(data[sample])
}
n=10000
bootobject<-boot(data=x,statistic=bootmean,R=n)

p-value =0

The histogram appears to be symmetric.

We reject the null hypothesis that mean =1 at 5% significance level.

1.b)

The t-critical value for a right-tailed test, for a significance level of α=0.05, is

tc​=1.645

1.c)

t.test(bootobject$t,alternative = "greater",mu=1,paired=FALSE,conf.level = 0.95)

Yes, we reject the null hypothesis that mean = 1 at 5% level of significance.

Both p-values approximately 0. We would consider t-test p-value to be most appropriate.


Related Solutions

in R. Generate a random sample of size 700 from a gamma distribution with shape parameter...
in R. Generate a random sample of size 700 from a gamma distribution with shape parameter 8 and scale parameter 0.1. Create a histogram of the sample data. Draw the true parametric density (for the specified gamma distribution) on the histogram. The curve for the density should be red. (Note: The “true parametric density” is the distribution from which the sample values were generated. It is NOT the kernel density that is estimated from the data.)
In R, get a sample of size n=5 from the Cauchy distribution and calculate its mean....
In R, get a sample of size n=5 from the Cauchy distribution and calculate its mean. (mean(rcauchy(5)). Repeat this 1000 times and plot the histogram of the resulting 1000 means. Please show your R codes. n <- 5 listofmeans <- c() for(i in 1:1000){ }listofmeans <- c(listofmeans, mean(rcauchy(n))) hist(listofmeans) Create other histograms, changing the value of n to 10, 30, 100, and 500. Comment on what these graphs show in light of the Central Limit Theorem.
Consider a sample of size 100 drawn from a population that obeys an unknown distribution. It...
Consider a sample of size 100 drawn from a population that obeys an unknown distribution. It is known that the population-variance (of some quality characteristic) is 6. Let µ denote the population-mean. Consider the following test of a hypothesis about µ. H0 : µ = 70 H1 : µ ≠ 70 (a) Calculate Z0.005. Explain the meaning of Z0.005. (b) If the sample mean is observed to be 71, would you reject H0 with 99% confidence? What is the p-value...
Question #3. A random sample of n = 9 is selected from a normal distribution with...
Question #3. A random sample of n = 9 is selected from a normal distribution with μ = 80 and σ=12. What is the probability that the sample mean will be between 75 and 86? Report to the thousandths Question #4. A random sample of n= 4 is obtained from a normal distribution μ= 30,σ= 8. What is the probability the sample mean will be smaller than M = 22? Report to the thousandths Question #5. A random sample of...
For this question assume that we have a random sample from a normal distribution with unknown...
For this question assume that we have a random sample from a normal distribution with unknown mean but known variance. (a) Suppose that we have 36 observations, the sample mean is 5, and the population variance is 9. Construct a 95% confidence interval for the population mean. (b) Repeat the preceding with a population variance of 25 rather than 9. (c) Repeat the preceding with a sample size of 25 rather than 36. (d) Repeat the preceding but construct a...
Use R to answer the following question. Copy and paste the code and answer from R...
Use R to answer the following question. Copy and paste the code and answer from R into your paper. On the average,five cars arrive at a particular car wash every hour. Let X count the number of cars that arrive from 10 AM to 11 AM. Then X ∼pois(lambda = 5). Also, μ = σ2 = 5.  What is the probability that no car arrives during this period?  Suppose the car wash above is in operation from 8AM...
Consider a random sample of size n from a distribution with function F (X) = 1-...
Consider a random sample of size n from a distribution with function F (X) = 1- x-2 if x > 1 and zero elsewhere. Determine if each of the following sequences has distribution limit; if so, give the limit distribution. a)x1:n b)xn:n c)n-1/2 xn:n
Consider the following observations on a receptor binding measure (adjusted distribution volume) for a sample of...
Consider the following observations on a receptor binding measure (adjusted distribution volume) for a sample of 13 healthy individuals: 22, 39, 40, 42, 43, 46, 52, 58, 63, 66, 68, 70, 73. (a) Is it plausible that the population distribution from which this sample was selected is normal? ( yes or no) , it ( is or is not) plausible that the population distribution is normal. (b) Calculate an interval for which you can be 95% confident that at least...
Consider the following observations on a receptor binding measure (adjusted distribution volume) for a sample of...
Consider the following observations on a receptor binding measure (adjusted distribution volume) for a sample of 13 healthy individuals: 22, 40, 41, 42, 43, 46, 51, 59, 62, 67, 68, 70, 71. (a) Is it plausible that the population distribution from which this sample was selected is normal? Yes Correct: Your answer is correct. , it is Correct: Your answer is correct. plausible that the population distribution is normal. (b) Calculate an interval for which you can be 95% confident...
This is the code in R for the Central Limit theorem question. This is Exponential distribution...
This is the code in R for the Central Limit theorem question. This is Exponential distribution with mean beta. How can I modify this code to Bernoulli(0.1), Uniform (0,4), and Normal distribution (2,1)    plot.z <- function(n, m=1e5, beta = 1) { mu <- beta sigma <- beta zs <- rep(0,m) for(i in 1:m) { Y.sample <- rexp(n, 1/beta) Ybar <- mean(Y.sample) zs[i] <- (Ybar - mu) / (sigma / sqrt(n)) } p <- hist(zs, xlim=c(-4,4), freq = F, main =...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT