Corresponding R code is given as;
x1_bar=c(3,4,5)
x2_bar=c(4,6,6)
S1=matrix(c(3,2,2,2,3,2,2,2,2),ncol=3,byrow=TRUE)
S2=matrix(c(3,2,2,2,3,2,2,2,4),ncol=3,byrow=TRUE)
C=matrix(c(1,-1,0,0,1,-1,1,0,-1),nrow=3,byrow=TRUE)
n1=10
n2=10
n=n1+n2-2
p=3
y=sqrt((n1*n2)/(n1+n2))*C%*%(x1_bar-x2_bar)
S=((n1-1)*S1+(n2-1)*S2)/(n1+n2+2)
S_new=C%*%S%*%t(C) #pooled S
library(MASS)
T2=t(y)%*%ginv(S_new)%*%y #T2 statistic
F=T2*(n-p+1)/(n*p) #F-statistic
F
qf(.975,p,n-p+1) #upper 5% point of F
#confidence interval
T.ci <- function(mu, Sigma, n, avec=rep(1,length(mu)),
level=0.95){
p <- length(mu)
if(nrow(Sigma)!=p) stop("Need length(mu) == nrow(Sigma).")
if(ncol(Sigma)!=p) stop("Need length(mu) == ncol(Sigma).")
if(length(avec)!=p) stop("Need length(mu) == length(avec).")
if(level <=0 | level >= 1) stop("Need 0 < level <
1.")
cval <- qf(level, p, n-p) * p * (n-1) / (n-p)
zhat <- crossprod(avec, mu)
zvar <- crossprod(avec, Sigma %*% avec) / n
const <- sqrt(cval * zvar)
c(lower = zhat - const, upper = zhat + const)
}
T.ci(mu=C%*%(x1_bar-x2_bar), Sigma=S_new, n=n, avec=c(1,0,0))
T.ci(mu=C%*%(x1_bar-x2_bar), Sigma=S_new, n=n, avec=c(0,1,0))
T.ci(mu=C%*%(x1_bar-x2_bar), Sigma=S_new, n=n, avec=c(0,1,0))
#calculating confidence interval by Bonferroni method
x_bar=C%*%(x1_bar-x2_bar)
TCI <- bon <- NULL
alpha <- 1 - 0.05/(2*3)
for(k in 1:3){
avec <- rep(0, 3)
avec[k] <- 1
TCI <- c(TCI, T.ci(x_bar, S_new, n, avec))
bon <- c(bon,
x_bar[k] - sqrt(S_new[k,k]/n) * qt(alpha, df=n-1),
x_bar[k] + sqrt(S_new[k,k]/n) * qt(alpha, df=n-1))
}
rtab <- rbind(TCI, bon)
round(rtab, 2)
Question 6 Consider two independent samples from 3-variate multivariate normal populations: 3 2 2 S2 3 2 1411 Population 1 with 12: sample size n 10, 13 3 2 21 Population 2 with 2 22sample size...
Please show your steps, thanks. The two samples below are independent from Normal populations with equal variances. Sample 1: Sample 2 18 13 381 8,289 4,471 t(x^2)= Question 2A Does the data indicate μ12μ2 at α-0.05?State the hypothesis in terms of 1-2. Step t H0: Ha: Step 2: Step 3 Fill in row 88 if the hypothesis is one tailed. Reject H0 i Fill in row 92 if the hypothesis is two tailed. The smaller number must be typed first....
Consider the following results for independent random samples taken from two populations. Sample 1 Sample 2 n1= 20 n2 = 40 x1= 22.1 x2= 20.6 s1= 2.9 s2 = 4.3 a. What is the point estimate of the difference between the two population means (to 1 decimal)? b. What is the degrees of freedom for the t distribution (round down)? c. At 95% confidence, what is the margin of error (to 1 decimal)? d. What is the 95% confidence interval...
the following results for independent random samples taken from two populations. Sample 1 Sample 2 n1-10 n2-30 x1-22.5 x2 20.6 S1-2.5 S2 4.9 a, What is the point estimate of the difference between the two population means (to 1 decimal)? b. What is the degrees of freedom for the t distribution (round down your answer to nearest whole number)? c. At 95% confidence, what is the margin of error (to 1 decimal)? d. What is the 95% confidence interval for...
Consider the following results for independent samples taken from two populations. Sample 1 Sample 2 ni = 400 n2= 300 P1= 0.44 P2= 0.36 a. What is the point estimate of the difference between the two population proportions (to 2 decimals)? b. Develop a 90% confidence interval for the difference between the two population proportions (to 4 decimals). Use z-table. to c. Develop a 95% confidence interval for the difference between the two population proportions (to 4 decimals). Use z-table....
Independent random samples were selected from each of two normally distributed populations, n = 6 from population 1 and n2 = 5 from population 2. The data are shown in the table to the right. Complete parts a through c below. 4.7 4.6 1.6 2.3 1.2 3.8 0.6 3.9 C. Test Ho: 02202 against He:0; >o. Use a = 0.01. Determine the test statistic. F= (Round to two decimal places as needed.) Find the p-value. p= (Round to three decimal...
9.6 in order to compare the means of two populations, inde- NW pendent random samples of 400 observations are selected from each population, with the following results Sample 1 Sample 2 $.240 s2 200 5,275 1150 a. Use a 95% confidence interval to estimate the dif- ference between the population means (μ,-μ Interpret the confidence interval. b. Test the null hypothesis Ho (μι-μ)--0 versus the c. Suppose the test in part b were conducted with the d. Test thenull hypothesis...
Question 5 Consider two normal populations N(H) and N(u2, 1). Let X, and 12 be the sample means of random samples from these two populations, respectively 1) (1 point) Find a pivotal quantity for Δ-μ,-,42, and derive the l-a confidence interval based on this pivotal quantity. 2) (1 point) State the relationship between the test and the confidence interval in 1). Question 5 Consider two normal populations N(H) and N(u2, 1). Let X, and 12 be the sample means of...
John has obtained two independent samples from two populations, where the sample statistics are shown in the table below. Assuming equal variances, he can construct a 95 percent confidence interval for the difference of the population means to be Sample 1 Sample 2 Mean 22.7 20.5 Variance (s^2) 5.4 3.6 Observations (sample size) 9 9 [0.08, 4.32] [1.17, 5.08] [2.44,6.19] [-0.09, 3.19] A corporate analyst is testing whether mean inventory turnover has increased. Inventory turnover in six randomly chosen product...
Consider the following competing hypotheses and accompanying sample data drawn independently from normally distributed populations. (You may find it useful to reference the appropriate table: z table or t table) H0: μ1 − μ2 ≥ 0HA: μ1 − μ2 < 0 x¯1x¯1= 249x−2x−2= 262s1 = 35s2 = 23n1 = 10n2 = 10a-1. Calculate the value of the test statistic under the assumption that the population variances are equal. (Negative values should be indicated by a minus sign. Round all intermediate calculations to at least 4 decimal places and final answer to 3 decimal places.) a-2. Find the p-value. multiple choice 1p-value < 0.010.01 ≤ p-value...
Consider the following data for two independent random samples taken from two normal populations. Sample 1 10 7 13 7 9 8 Sample 2 9 7 8 4 5 9 (a) Compute the two sample means. Sample 1Sample 2 (b) Compute the two sample standard deviations. (Round your answers to two decimal places.) Sample 1Sample 2 (c) What is the point estimate of the difference between the two population means? (Use Sample 1 − Sample 2.) (d) What is the...