> ### we have given x and y variable: > x=c(6. 96,26.95,17. 86,11.53,10. 81,27,21.10,11. 30,19.8,16. 86) [1] 6.96 26. 95 17. 86 11.53 10. 81 27.00 21.10 11. 30 19.80 16. 86 > y= c(10. 5,33. 5,17. 22,31. 57 ,8. 2, 21. 94,43. 21,20.78) [1] 10. 50 33.50 17.22 31.57 8. 20 21.94 43. 21 20.78 > ## > xbar= mean(x) > xbar [1] 17.017 a) calcualte xbar variance/ (n) so first calculate variance : varl > ## b) variance of xbar > var1= var (x) > vari [1] 47. 32638 > ni = > n1 [1] 10 length(x)
> var_xbari > var_xbar1 [1] 4.732638 var1/(n1) > ## c) calculate y bar > ybar= mean(y) > ybar [1] 23. 365 > ## d) variance of ybar > var2 =var (y) > var2 [1] 143. 6891 > n2=length(y) > n2 [1] 8 = var 2 / (n2) so first calculate variance : var2 > var_ybar1 > var_ybar1 [1] 17.96114 = var2 / (n2)
> ## e) calculate varince of xbar - ybar : > V= var_xbar1 var_ybar1 [1] -13. 2285 critical value for 94 % : used here two tailed test : > ## f) > crit =qnorm (1-0.06/2) > crit [1] 1. 880794 > ## g) 94 % confidence interval for difference between population means. > ### here we know population standard deviation for x and y > sigmal- 7.3 > sigma2 = 11.1 > mean_df - > mean_df [1] -6. 348 xbar ybar
sqrt((sigmal/n1)+ (sigma2/n2)) > se - > se [1] 1.455163 > lower_limit > lower_limit [1] -9.084862 mean_df (crit*se) > upper_limit = mean_df + (crit*se) > upper_limit [1] -3. 611138 > ## interval does not include nul1 value hence it is significant . > ## h) assume here equal variance hence here length is nl+n2 -2 = = 16 uy = 0 vs H1 : ux < uy (it is left tailed test) > ## i) test for : Ho : ux -
## test statistics (mean_df) /se [1] -4.362397 > ## p value = > pnorm(z) [1] 6.432251e-06 > ## decision : we reject Ho if p value is less than alpha value here p value is less > ## than alpha value we reject Ho here . > ## Conclusion : there is enough evidence to conclude that there is population mean (ux) less > ## the population mean (uy)
### we have given x and y variable: x=c(6. 96,26. 95,17.86,11. 53,10. 81,27, 21.10,11. 30,19. 8,16. 86) х y= c(10. 5,33.5,17.22,31. 57,8.2,21.94,43. 21,20.78) У a) calcualte xbar xbar= mean(x) xbar variance/ (n) so first calculate variance : var1 ## b) variance of xbar var1= var (x) var1 ni = length(x) n1 var_xbari = var1/(n1) var_xbari ## c) calculate y bar ybar= mean(y) ybar ## d) variance of ybar = var2 / (n2) so first calculate variance var2 =var (y) : var2 var2 n2=1ength(y) n2 = var2 / (n2) var_ybari var_ybar1
## e) calculate varince of xbar ybar : v= var_xbarl - var_ybar1 ## f) critical value for 94 % : used here two tailed test : crit =qnorm(1-0.06/2) crit ## g) 94 % confidence interval for difference between population means. ### here we know population standard deviation for x and y sigmal= 7.3 sigma2 = 11.1 mean_df mean_df = xbar ybar sqrt ((sigmal/n1)+ (sigma2/n2)) se = se lower_limit = mean_df lower_limit (crit*se) upper_limit upper_limit = mean_df + (crit*se) ## interval does not include null value hence it is significant . ## h) assume here equal variance hence here length is n1+n2 -2 = = 16 uy = 0 vs H1 : ux < uy (it is left tailed test) ## i) test for : Ho : ux -
## test statistics (mean_df) /se ## p value = pnorm(z) ## decision : we reject Ho if p value is less than alpha value herep value is less ## than alpha value we reject Ho here . ## Conclusion : there is enough evidence to conclude that there is population mean (ux) less ## the population mean (uy)