Handout01 Stat6250 Simple SAS Example from Ch. 1 Note how SAS uses the path on the computer to load a data file using the input statement. See pages 5, 6 ------------------------------------------------------------------------------ *Program 1-1 A sample SAS program; *SAS Program to read veggie data file and to produce several reports; options nocenter nonumber; data veg; infile "c:\books\learning\veggies.txt"; input Name $ Code $ Days Number Price; CostPerSeed = Price / Number; run; title "List of the Raw Data"; proc print data=veg; run; title "Frequency Distribution of Vegetable Names"; proc freq data=veg; tables Name; run; title "Average Cost of Seeds"; proc means data=veg; var Price Days; run; ------------------------------------------------------------------------------ Output: Cost Obs Name Code Days Number Price PerSeed 1 Cucumber 50104-A 55 30 195 6.50000 2 Cucumber 51789-A 56 30 225 7.50000 3 Carrot 50179-A 68 1500 395 0.26333 4 Carrot 50872-A 65 1500 225 0.15000 5 Corn 57224-A 75 200 295 1.47500 6 Corn 62471-A 80 200 395 1.97500 7 Corn 57828-A 66 200 295 1.47500 8 Eggplant 52233-A 70 30 225 7.50000 The FREQ Procedure Cumulative Cumulative Name Frequency Percent Frequency Percent ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ Carrot 2 25.00 2 25.00 Corn 3 37.50 5 62.50 Cucumber 2 25.00 7 87.50 Eggplant 1 12.50 8 100.00 The MEANS Procedure Variable N Mean Std Dev Minimum Maximum ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ Price 8 281.2500000 78.5470741 195.0000000 395.0000000 Days 8 66.8750000 8.5596645 55.0000000 80.0000000 ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ