Simple statistics Hypothesis testing for the difference in means of two samples. Syntax [h,significance,ci] = ttest2(x,y) [h,significance,ci] = ttest2(x,y,alpha) [h,significance,ci] = ttest2(x,y,alpha,tail) Description performs a t-test to determine whether two samples from a h = ttest2(x,y) normal distribution (in and could have the same mean when the standard x y) deviations are unknown but assumed equal. the result, is 1 if you can reject the null hypothesis at the 0.05 significance level h, alpha and 0 otherwise. is the p-value associated with the T-statistic. significance is the probability that the observed value of T could be as large or significance larger under the null hypothesis that the mean of is equal to the mean of x y. is a 95% confidence interval for the true difference in means. ci gives control of the [h,significance,ci] = ttest2(x,y,alpha) significance level, For example if = 0.01, and the result, is 1, you alpha. alpha h, can reject the null hypothesis at the level 0.01. in this case is a significance ci 100(1-alpha)% confidence interval for the true difference in means. allows specification of one or two-tailed ttest2(x,y,alpha,tail) tests. is a flag that specifies one of three alternative hypotheses: tail tail = 0 (default) specifies the alternative, .  tail = 1 specifies the alternative, .   tail = -1 specifies the alternative, . Examples This example generates 100 normal random numbers with theoretical mean zero and standard deviation one. We then generate 100 more normal random numbers with
Simple statistics Hypothesis testing for the difference in means of two samples. Syntax [h,significance,ci] = ttest2(x,y) [h,significance,ci] = ttest2(x,y,alpha) [h,significance,ci] = ttest2(x,y,alpha,tail) Description h = ttest2(x,y) performs a t-test to determine whether two samples from a normal distribution (in x and y) could have the same mean when the standard deviations are unknown but assumed equal. h, the result, is 1 if you can reject the null hypothesis at the 0.05 significance level alpha and 0 otherwise. significance is the p-value associated with the T-statistic. significance is the probability that the observed value of T could be as large or larger under the null hypothesis that the mean of x is equal to the mean of y. ci is a 95% confidence interval for the true difference in means. [h,significance,ci] = ttest2(x,y,alpha) gives control of the significance level, alpha. For example if alpha = 0.01, and the result, h, is 1, you can reject the null hypothesis at the significance level 0.01. ci in this case is a 100(1-alpha)% confidence interval for the true difference in means. ttest2(x,y,alpha,tail) allows specification of one or two-tailed tests. tail is a flag that specifies one of three alternative hypotheses:  tail = 0 (default) specifies the alternative, .  tail = 1 specifies the alternative, .  tail = -1 specifies the alternative, . Examples This example generates 100 normal random numbers with theoretical mean zero and standard deviation one. We then generate 100 more normal random numbers with
Notes10.docx