Question

In: Statistics and Probability

Suppose X1, . . . , Xn is a random sample from the Normal(μ, σ2) distribution,...

Suppose X1, . . . , Xn is a random sample from the Normal(μ, σ2) distribution, where μ is unknown but σ2 is known, and it is of interest to test H0: μ = μ0 versus H1: μ ̸= μ0 for some value μ0. The R code below plots the power curve of the test

Reject H0 iff |√n(X ̄n − μ0)/σ| > zα/2

for user-selected values of μ0, n, σ, and α. For a sequence of values of μ, the code computes the probability that the null hypothesis will be rejected according to the above test. In addition, for each value of μ in the sequence, a simulation is run: 100 data sets with sample size n are generated from the Normal(μ,σ2) distribution, and for each of the 100 data sets, it is recorded whether the null hypothesis was rejected. For each value of μ, the proportion of times the null hypothesis is rejected is recorded. This gets plotted as a dashed line.

      mu.0 <- ???
      n <- ???
      sigma <- ???
      alpha <- ???
      mu.seq <- seq(mu.0 - 5,mu.0 + 5,length=50)
      power.theoretical <- numeric()
      power.empirical <- numeric()
      for(j in 1:length(mu.seq))
      {
          power.theoretical[j] <- 1-(pnorm(qnorm(1-alpha/2)-sqrt(n)*(mu.seq[j] - mu.0)/sigma)
reject <- numeric()
for(s in 1:100)
{

}

-pnorm(-qnorm(1-alpha/2)-sqrt(n)*(mu.seq[j] - mu.0)/sigma))
x <- rnorm(n,mu.seq[j],sigma)
x.bar <- mean(x)
reject[s] <- abs(sqrt(n)*(x.bar-mu.0)/sigma) > qnorm(1-alpha/2)
       power.empirical[j] <- mean(reject)
   }
   plot(mu.seq,power.theoretical,type="l",ylim=c(0,1),xlab="mu",ylab="power")
   lines(mu.seq, power.empirical,lty=2)
   abline(v=mu.0,lty=3)  # vert line at null value
   abline(h=alpha,lty=3) # horiz line at size

(a) Putinμ0 =2,n=5,σ=2,andα=0.05andexecutethecode. Turnintheplot.

(b) Explain why the dashed line follows the solid line closely but not exactly.

(c) Interpret the height of the solid line at μ = 4.

(d) Interpret the height of the solid line at μ = 2.

(e) Interpret the height of the dashed line at μ = 2.

(f) What would be the effect on the height of the solid line at μ = 4 if i. the sample size n were increased?

ii. the standard deviation σ were increased? iii. the size α of the test were increased?

(g) What would be the effect on the height of the solid line at μ = 2 if i. the sample size n were increased?

ii. the standard deviation σ were increased? iii. the size α of the test were increased?

(h) What would be the effect on the dashed line of generating 500 data sets instead of only 100 data sets for the simulation at each value of μ?

Solutions

Expert Solution

Here

n =25

If : -0.3 0.3

otherwise

Probability of a Standard normal distribution provides variance between 0 and 1.

In standard distribution mean will be zero and Z mean value =0.5 and Z value will always measured from left to right.

Z1(1.5) is right hand side of Z table right curve. will always be more than mean value. The covered area of Z(1.5) will be meansered from left to right. So, that area was 93.32%

Z2(-1.5), which is less than Mean value and data coveres less than half of the area. Using Left hand Z table value of 1.5 =0.9332

The area of probability is covered between -0.3 and 0.3 and mean value is 0. So, Probability of area covered between which is P(Z1) is area covred from 0 to 93.32%. Means from Left hand to right hand of Standard distribution.

# Example : This is equal to P(Z < 1.96) - P(Z < -1.96) = F(1.96) - F(-1.96) = F(1.96) - (1 - F(1.96)) = 2 F(1.96) - 1

Probability of type 1 error of the test that accepts H0 :

Probability of (-0.3 0.3) = P( Xn0.3)-P(Xn-0.3)

= P(0.3) -(1-P(0.3))

= 0.9332-(1-0.9332)

= 2*0.9332- 1

= 0.8664


Related Solutions

Suppose that (X1, · · · , Xn) is a sample from the normal distribution N(θ,...
Suppose that (X1, · · · , Xn) is a sample from the normal distribution N(θ, θ^2 ) with θ ∈ R. Find an MLE of θ.
Suppose that X1, ..., Xn form a random sample from a uniform distribution for on the...
Suppose that X1, ..., Xn form a random sample from a uniform distribution for on the interval [0, θ]. Show that T = max(X1, ..., Xn) is a sufficient statistic for θ.
Suppose X1, X2, . . . , Xn is a random sample from N(μ, 16). Find...
Suppose X1, X2, . . . , Xn is a random sample from N(μ, 16). Find the maximum likelihood estimator of the 95th percentile.
: Let X1, X2, . . . , Xn be a random sample from the normal...
: Let X1, X2, . . . , Xn be a random sample from the normal distribution N(µ, 25). To test the hypothesis H0 : µ = 40 against H1 : µne40, let us define the three critical regions: C1 = {x¯ : ¯x ≥ c1}, C2 = {x¯ : ¯x ≤ c2}, and C3 = {x¯ : |x¯ − 40| ≥ c3}. (a) If n = 12, find the values of c1, c2, c3 such that the size of...
. Let X1, X2, . . . , Xn be a random sample from a normal...
. Let X1, X2, . . . , Xn be a random sample from a normal population with mean zero but unknown variance σ 2 . (a) Find a minimum-variance unbiased estimator (MVUE) of σ 2 . Explain why this is a MVUE. (b) Find the distribution and the variance of the MVUE of σ 2 and prove the consistency of this estimator. (c) Give a formula of a 100(1 − α)% confidence interval for σ 2 constructed using the...
2. Let X1, . . . , Xn be a random sample from the distribution with...
2. Let X1, . . . , Xn be a random sample from the distribution with pdf given by fX(x;β) = β 1(x ≥ 1). xβ+1 (a) Show that T = ni=1 log Xi is a sufficient statistic for β. Hint: Use n1n1n=exp log=exp −logxi .i=1 xi i=1 xi i=1 (b) Find the pdf of Y = logX, where X ∼ fX(x;β). (c) Find the distribution of T . Hint: Identify the distribution of Y and use mgfs. (d) Find...
Let X1, . . . , Xn be a random sample from a uniform distribution on...
Let X1, . . . , Xn be a random sample from a uniform distribution on the interval [a, b] (i) Find the moments estimators of a and b. (ii) Find the MLEs of a and b.
Suppose X1, X2, ..., Xn is a random sample from a Poisson distribution with unknown parameter...
Suppose X1, X2, ..., Xn is a random sample from a Poisson distribution with unknown parameter µ. a. What is the mean and variance of this distribution? b. Is X1 + 2X6 − X8 an estimator of µ? Is it a good estimator? Why or why not? c. Find the moment estimator and MLE of µ. d. Show the estimators in (c) are unbiased. e. Find the MSE of the estimators in (c). Given the frequency table below: X 0...
Let X1,X2,...,Xn be a random sample from any distribution with mean μ and moment generating function...
Let X1,X2,...,Xn be a random sample from any distribution with mean μ and moment generating function M(t). Assume that M(t) is finite for some t > 0. Let c>μ be any constant. Let Yn = X1+X2+···+Xn. Show that P(Yn ≥ cn) ≤ exp[−n a(c)] where P(Yn ≥ cn) ≤ exp[−n a(c)] a(c) = sup[ct − ln M (t)]. t > 0
Let X1,X2, . . . , Xn be a random sample from the uniform distribution with...
Let X1,X2, . . . , Xn be a random sample from the uniform distribution with pdf f(x; θ1, θ2) = 1/(2θ2), θ1 − θ2 < x < θ1 + θ2, where −∞ < θ1 < ∞ and θ2 > 0, and the pdf is equal to zero elsewhere. (a) Show that Y1 = min(Xi) and Yn = max(Xi), the joint sufficient statistics for θ1 and θ2, are complete. (b) Find the MVUEs of θ1 and θ2.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT