Is there evidence that the mean height of sixth-grade students depends on gender? The mean height of the male sample is m 2=63.9100 with a standard deviation of s 2=4.9379. The mean height of the female sample is m 1=60.5889 with a standard deviation of s 1=5.0183. Random samples of n 1=9 females and n 2=10 males are selected. The heights of sixth-grade students are normally distributed. In a textbook, the problem is usually accompanied by a little story, like this: You can use a data set like this one to conduct a two-sample t test of independent means. The Height column shows the value of the statistics for each group. The _STAT_ variable specifies the name of the statistics that are used in standard formulas for computing confidence intervals and hypothesis tests. The two samples are defined by the levels of the Sex variable ('F' for females and 'M' for males). The table shows the structure of the SummaryStats data set for two-sample tests. Proc print data=SummaryStats label noobs Proc means data=class noprint /* compute summary statistics by group */ by sex /* group variable */ var height /* analysis variable */ output out=SummaryStats /* write statistics to data set */ run The following SAS statements sort the data by the grouping variable, call PROC MEANS to write the summary statistics to a data set, and print a subset of the statistics:īy sex /* sort by group variable */ run Because we are interested in a two-sample test, the data must also contain a grouping variable. To use PROC TTEST on summary statistics, the statistics must be in a SAS data set that contains a character variable named _STAT_ with values 'N', 'MEAN', and 'STD'. The data are contained in the Sashelp.Class data set. Rather than repeat the documentation example, let's compare the mean heights of 19 students based on gender.
2 T TEST IN SAS JMP HOW TO
The documentation for PROC TTEST includes an example that shows how to compute a two-sample t test for the difference between the means of two groups. Students in introductory statistics courses often use summary statistics (such as sample size, mean, and standard deviation) to test hypotheses and to compute confidence intervals.ĭid you know that you can provide summary statistics (rather than raw data) to PROC TTEST in SAS and obtain hypothesis tests and confidence intervals? This article shows how to create a data set that contains summary statistics and how to call PROC TTEST to compute a two-sample or one-sample t test for the mean.ĭid you know you that PROC TTEST in #SAS can analyze summary statistics? Click To Tweet Run a two-sample t test for difference of means from summarized statistics