When using R to calculate Assignment X3-Q11-(iii)-b, I get an interval (-0.2447308,Inf) from R, which is far from the number I got from table. How can I fix my code? Is there anything I didn't notice? My code is A=c(4.59,5.05,4.49,5.33,4.66,4.98,5.67,5.23) B=c(4.75,5.03,4.66,5.56,4.9,4.88,5.8,5.33) t.test(B,A,alt="greater",var.equal=TRUE) And could I just type R code in Paper A exam?
Hi Ykai R does not give you a critical value as part of the output from the test, it gives a p-value so here 0.2925, which you would compare with 5%. To get the critical value you would use qt(0.95,14)=1.76131 which matches the tables but with more decimals. You would not give the examiners your R code, but you could say 'the critical value is 1.76131 (from R)', then the examiners will know why it is slightly different to the table value. Thanks Andrea