Math 324 lab 5 (Seed Number = 0945) Confidence Intervals and Confidence Level Ba
ID: 3310571 • Letter: M
Question
Math 324 lab 5 (Seed Number = 0945)
Confidence Intervals and Confidence Level
Background: Confidence level C is the probability that a confidence interval making procedure will make an interval that will include the estimated parameter. That is, making a confidence interval for the mean µ of a numerical population by the formula x±m should have x-mx+m about C percent of the time. The goal of this lab is to support that statistically. The guidelines below are stated in terms of Excel, but you can use any other program of your choice
Use "Random Numbers Generation" to generate 16 columns of random numbers, 40 numbers in each column, using Normal distribution with =150, =40. Use the last 4 digits of your student ID as a seed number. Put the data in the range A2:P41 (leaving the first row open for column labels). That will produce 40 random samples size n=16 each from a Normal population.
Enter the formula =average(A2:P2) into the cell Q2 and drag it down the Q column. In Q1 put the label “means”.
Use confidence level C=90% to compute the margin of error m=z2n . Use it to compute endpoints of the z-interval in each row and put them in the adjacent columns R and S. Put labels “z-lend” and “z-rend” in cells R1 and S1. Label column T as “success” in T1 and put in each cell of that column 1 if falls within the z-interval for that sample or 0, if not. The total of column T will be the number of “successful” z-intervals.
Use confidence level C=90% to compute the margin of error m=tn-1,2sn for each row and put it in column U. To do that, find in advance values of tn-1,2 and n , and use them together with the function STDEV(A2:P2) in the formula to be entered in cell U2 and dragged down that column. Label column U ” t-margin” in cell U1. Use t-margins from column U to compute endpoints of t-intervals in each row and put them in adjacent columns V and W. Put labels “t-lend” and “t-rend” in cells V1 and W1. Label column X as “success” in X1 and put in each cell of that column 1 if falls within the t-interval from that sample or 0, if not. The total of column X will be the number of “successful” t-intervals.
Open a text box and put there name, section #, “lab 5” and seed number. Report how the numbers of successful z- and t-intervals agree with the used confidence level C = 90%.
In the printout, include the report and all columns starting from column Q on. DO NOT include the generated data! Use smaller fonts if needed to fit one page. Sign.
Explanation / Answer
find R code for above problem:
mu<-150
sigma<-40
n<-16
asim<-40
#margin of error
m=qnorm(0.95)*40*sqrt(16)
l90<-rep(NA,asim)
r90<-rep(NA,asim)
set.seed(0945)
for(i in 1:asim)
{
x<-rnorm(n,mu,sigma)
zlend[i]<-mean(x)-qnorm(0.95)*sqrt(sigma^2/n)
zrend[i]<-mean(x)+qnorm(0.95)*sqrt(sigma^2/n)
}
success1=((l90<=150)&(150<=r90))
success=ifelse(success1==TRUE,1,0)
sum(success)