Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
STAT 3000 Getting a Point Estimate, Standard Error, and t-Interval for a Single Population Mean from SAS This is a continuation of the metal cylinder data discussed in Example 14 of the textbook (see pages 268, 273, 285, 330, 333, 346, 351, and 361), and discussed in the previous handout titled “Using SAS Software and Obtaining the Datasets Used in the Text”. The program below reads in these data (stored in the file fig6.5-metal-cylinders.txt), computes the mean and standard error of the mean, constructs a two-sided confidence interval for average diameter (see page 330), and computes a test statistic and p-value for a test of the null hypothesis that the average diameter is equal to 50 mm (see pages 346, 351, and 361). data cylinder; infile "C:\CHRIS\CLASSES\STAT3000\datasets_third_ed\ASCII tabbed datasets\Chapter 6\fig6.5-metal-cylinders.txt" firstobs=2; input diameter; run; proc means data=cylinder; var diameter; run; proc ttest data=cylinder h0=50; var diameter; run; proc ttest data=cylinder h0=50 alpha=0.01; var diameter; run; PROC MEANS is a quick way of getting a few basic summary statistics (unlike the volume of output produced by PROC UNIVARIATE), including the sample mean and standard deviation. PROC TTEST allows you to obtain a confidence interval and p-value for a hypothesis test. The output from this proc also includes the standard error of the sample mean. Note that for this example we are interested in whether the machine is calibrated incorrectly – correct calibration in this case is manifested by an average diameter of 50 mm. The “null hypothesis” therefore is that the average is 50, versus the alternative that it is not 50. This hypothesis is specified by the h0=50 option in the PROC TTEST statement. One last note: the default value for alpha is 0.05, although you can specify any value you wish using the alpha= option, as shown above. As an illustration, the second PROC TTEST uses and alpha of 0.01, which yields a 99% confidence interval. The raw output is shown on the page following, but in summary we conclude that the average metal diameter for this machine is 49.999, with a standard deviation of 0.1337 and a standard error of 0.0173. We are 95% confident that the average diameter for this machine is between 49.9643 and 50.0334 mm. (And 99% confident that the average diameter is between 49.9529 and 50.0448 mm.) To test that the machine is calibrated correctly, with an average diameter of 50 mm, SAS reports a t statistic of -0.07 (on 59 df), with a p-value of 0.95. There is no evidence whatsoever that the machine is incorrectly calibrated. RAW OUTPUT PROC MEANS: Analysis Variable : diameter N Mean Std Dev Minimum Maximum ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ 60 49.9988333 0.1336968 49.7400017 50.3600006 ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ FIRST PROC TTEST: The TTEST Procedure Variable: diameter N Mean Std Dev Std Err Minimum Maximum 60 49.9988 0.1337 0.0173 49.7400 50.3600 Mean 49.9988 95% CL Mean 49.9643 Std Dev 50.0334 95% CL Std Dev 0.1337 0.1133 DF t Value Pr > |t| 59 -0.07 0.9463 0.1631 SECOND PROC TTEST: The TTEST Procedure Variable: N Mean Std Dev Std Err Minimum Maximum 60 49.9988 0.1337 0.0173 49.7400 50.3600 Mean 49.9988 . diameter 99% CL Mean 49.9529 Std Dev 50.0448 0.1337 DF t Value Pr > |t| 59 -0.07 0.9463 99% CL Std Dev 0.1078 0.1742