The R-code is
N=10000# number of replicates
X1=0 #for number of samples contains CI for gausian
X2=0#for number of samples contains CI for exponential
for( i in 1:N)
{set.seed(i+i)
X=rnorm(10) #genrate random numbers from gausian distribution with mean 0 and variance 1
LL=mean(X)-qt(1-0.05,9)*(sd(X)/sqrt(length(X)))
UL=mean(X)+qt(1-0.05,9)*(sd(X)/sqrt(length(X)))
if(LL<0 && 0<UL) X1=X1+1
}
for( i in 1:N)
{set.seed(i+i)
X=rexp(10,1)#generate random numbers with exponential distribution with mean 1
LL=mean(X)-qt(1-0.05,9)*(sd(X)/sqrt(length(X)))
UL=mean(X)+qt(1-0.05,9)*(sd(X)/sqrt(length(X)))
if(LL<1 && 1<UL) X2=X1+1
}
prop.test(X1,N,0.90,conf.level=0.90)#for Gaussian
prop.test(X2,N,0.90,conf.level=0.90)#for exponential
The output of code is
>N=10000# number of replicates
>X1=0 #for number of samples contains CI for gausian
>X2=0#for number of samples contains CI for exponential
>for( i in 1:N)
>{set.seed(i+i)
>X=rnorm(10) #genrate random numbers from gausian distribution with mean 0 and variance 1
>LL=mean(X)-qt(1-0.05,9)*(sd(X)/sqrt(length(X)))
>UL=mean(X)+qt(1-0.05,9)*(sd(X)/sqrt(length(X)))
>if(LL<0 && 0<UL) X1=X1+1
>}
>for( i in 1:N)
>{set.seed(i+i)
>X=rexp(10,1)#generate random numbers with exponential distribution with mean 1
>LL=mean(X)-qt(1-0.05,9)*(sd(X)/sqrt(length(X)))
>UL=mean(X)+qt(1-0.05,9)*(sd(X)/sqrt(length(X)))
>if(LL<1 && 1<UL) X2=X1+1
>}
>prop.test(X1,N,0.90,conf.level=0.90)#for Gaussian
-sample proportions test with continuity correction
data: X1 out of N, null probability 0.9
X-squared = 1.0336, df = 1, p-value = 0.3093
alternative hypothesis: true p is not equal to 0.9
90 percent confidence interval:
0.8980735 0.9079062
sample estimates:
p
0.9031
>prop.test(X2,N,0.90,conf.level=0.90)#for exponential
1-sample proportions test with continuity correction
data: X2 out of N, null probability 0.9
X-squared = 1.1025, df = 1, p-value = 0.2937
alternative hypothesis: true p is not equal to 0.9
90 percent confidence interval:
0.8981757 0.9080040
sample estimates:
p
0.9032
# The CI for desired coverage in case of standard gausian distribution is(0.8980735 ,0.9079062) which contains true coverage
# The CI for desired coverage in case of standard exponential distribution( 0.8981757, 0.9080040) which contains true coverage
*related to R programming* Using simulation, estimate the coverage for the t-based interval ☺ ta/2,n-1.sx/vn for...
R problem 1: The reason that the t distribution is important is that the sampling distribution of the standardized sample mean is different depending on whether we use the true population standard deviation or one estimated from sample data. This problem addresses this issue. 1. Generate 10,000 samples of size n- 4 from a normal distribution with mean 100 and standard deviation σ = 12, Find the 10,000 sample means and find the 10,000 sample standard deviations. What are the...
R
programming question
a) Do in R OR by hand
b) Do using R only. Don’t forget confidence interval.
. The commute time between LPC and Loop campus is X+ Y, where X is the time in minutes to wait for train and Y is the time in minutes for the train travel. Suppose that X has a zero-inflated exponential distribution, i.e., the cumulative probability distribution is: 0, 0.4 1 0.6e-/5 -oo x<0, Fx(x) 0 r oo. Suppose that Y...
8.1.5 Question Help Determine the 95% confidence interval estimate for the population mean of a normal distribution given n = 100, o = 133, and x = 1,500 The 95% confidence interval for the population mean is from to (Round to two decimal places as needed. Use ascending order.) 8.1.14-T Question Help As a follow-up to a report on gas consumption, a consumer group conducted a study of SUV owners to estimate the mean mileage for their vehicles. A simple...
5. The servicing time at the drive-through lane of a fast food restaurant follows an exponential distribution. The average servicing time is 2 minutes. (4 points) YORKVILLE BUSI 1013 statistics for Business What is the probability that it takes more than 2.5 minutes to service a customer at the drive-through lane? b. a. What percent of customers at the drive-through lane will take between 1 to 3 minutes to service? Part B 1. A simple random sample of 50 customers...
Consider a 90% confidence interval for µ not known. For which sample size, n = 10 or n = 20, is the confidence interval longer? Critical Thinking Lorraine computed a confidence interval for µ based on a sample of size 41. Since she did not know α, she used s in her calculations. Lorraine used the normal distribution for the confidence interval instead of a Student's t distribution. Was her interval longer or shorter than one obtained by using an...
The mean and the standard deviation of the sample of 100 bank customer waiting times are x¯x¯ = 5.14 and s = 2.321. Calculate a t-based 95 percent confidence interval for µ, the mean of all possible bank customer waiting times using the new system. Are we 95 percent confident that µ is less than 6 minutes?. Assume normality. (Choose the nearest degree of freedom for the given sample size. Round your answers to 3 decimal places.) The t-based 95 percent confidence interval is [, ]. (Click to select)YesNo , interval is (Click to select)lessmore than...
1.)
2.)
3.)
4.)
5.)
An advertising executive wants to estimate the mean weekly amount of time consumers spend watching traditional television daily. Based on previous studies, the standard deviation is assumed to be 23 minutes. The executive wants to estimate, with 99% confidence, the mean weekly amount of time to within + 6 minutes. a. What sample size is needed? b. If 95% confidence is desired, how many consumers need to be selected? a. The sample size required for...
1) Out of 100 people sampled, 60 preferred Candidate A. Based on this, estimate what proportion of the voting population (pp) prefers Candidate A. Use a 99% confidence level, and give your answers as decimals, to three places. _____ < P < ______ 2) You work for a marketing firm that has a large client in the automobile industry. You have been asked to estimate the proportion of households in Chicago that have two or more vehicles. You have been...
Determine the upper-tail critical value t Subscript alpha divided by 2tα/2 in each of the following circumstances. a.a. 1−α=0.90, n=49 d. 1−α=0.90, n=69 b.b. 1−α=0.99, n=49 e. 1−α=0.95, n=43 c.c. 1−α=0.90, n=8 A marketing researcher wants to estimate the mean savings ($) realized by shoppers who showroom. Showrooming is the practice of inspecting products in retail stores and then purchasing the products online at a lower price. A random sample of 121 shoppers who recently purchased a consumer electronics item...
Suppose X1, .., Xn is a random sample from a N(0, a2) population, where variance o are known. Consider testing Ho : 0 = O0 vs. Hi 0 700 Q1(4pt): Using Likelihood Ratio Test (LRT) to obtain a level a test that rejects Ho if Уп(X — во) VП(х — во) <21-a/2 21-a/2 or о Q2(1pt): Is the two-sided test derived in 1) an uniformly most powerful test? If not, briefly state your reasons Q3 (1pt): Note that the test...