Question

4.2.12. In Exercise 4.2.11, the sampling was from the N(0,1) distribution. Show, however, that setting μ...

4.2.12. In Exercise 4.2.11, the sampling was from the N(0,1) distribution. Show, however, that setting μ = 0 andσ = 1 is without loss of generality. Hint: First,X1,...,Xn is a random sample from the N(μ,σ2) if and only if Z1,...,Zn is a random sample from the N(0,1), where Zi =( Xi − μ)/σ. Then show the confidence interval based on the Zi’s contains 0 if and only if the confidence interval based on the Xi’s contains μ.


For more info about 4.2.11 :

(4.2.11. Let X1,...,Xn be a random sample from a N(0,1) distribution. Then the probability that the random interval X±tα/2,n−1(s/√n) trapsμ = 0 is (1−α). To verify this empirically, in this exercise, we simulate m such intervals and calculate the proportion that trap 0, which should be “close”to (1−α). (a) Set n = 10 andm = 50. Run the R code mat=matrix(rnorm(m*n),ncol=n) which generates m samples of size n from the N(0,1) distribution. Each row of the matrix mat contains a sample. For this matrix of samples, the function below computes the (1 − α)100% confidence intervals, returning them in a m×2 matrix. Run this function on your generated matrix mat. What is the proportion of successful confidence intervals?
246 Some Elementary Statistical Inferences
getcis <- function(mat,cc=.90){ numb <- length(mat[,1]); ci <- c() for(j in 1:numb) {ci<-rbind(ci,t.test(mat[j,],conf.level=cc)$conf.int)} return(ci)} This function is also at the site discussed in Section 1.1.
(b) Run the following code which plots the intervals. Label the successful intervals. Comment on the variability of the lengths of the confidence intervals. cis<-getcis(mat); x<-1:m plot(c(cis[,1],cis[,2])~c(x,x),pch="",xlab="Sample",ylab="CI") points(cis[,1]~x,pch="L");points(cis[,2]~x,pch="U"); abline(h=0))

0 0
Add a comment Improve this question Transcribed image text
Answer #1

n=10 m=50 matematrix(rnorm(m®n), ncol=n) getcis = function(mat, CC=0.90){ numb = length(mat[,2]) ci = c() for(j in 1:numb){ c# # # # # # # # # # # # # # # # # # ########### ## [21] -1.288379458 8.31164588 ## [22, 1 3 ,869876471 1.54295117 ## [23] -8.cis<-getcis(mat) X<-1:m plot(c(cis[,1],cis[,2])-C(x,x), pch=,xlab=Sample, ylab=CI) points(cis[,1]-X, pch=L); points(c

Add a comment
Know the answer?
Add Answer to:
4.2.12. In Exercise 4.2.11, the sampling was from the N(0,1) distribution. Show, however, that setting μ...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT