HNFAS/TPSS 603 PC SAS Laboratory Exercise 1: Getting

advertisement

HNFAS/TPSS 603

PC SAS Laboratory

Exercise 1: Getting Acquainted with PC SAS for Windows

Objectives:

1.

2.

3.

Learn the basic commands for PC SAS for Windows.

Learn to develop or use a data set in PC SAS.

Use PC SAS Analyst to do an ANOVA on a simple RCBD problem.

Procedures:

Select START , select PROGRAMS and then select SAS from the programs listed on the menu to the right and double click the mouse button, or click on Statistical & Spreadsheet and then select SAS System . Wait for awhile before pressing any other keys as it takes several seconds for the program to be loaded as it is very large.

Three windows will appear on the screen. The top window is the LOG that displays SAS messages about the program that was run. The bottom window is the PROGRAM EDITOR which is where you enter SAS statements to be executed. The window on the left will toggle between Results and Explorer to monitor working files.

The results from the SAS procedures are displayed in the OUTPUT WINDOW . To display the OUTPUT WINDOW, select WINDOW from the menu bar (click on it) and a list of the five windows will be displayed. Select OUTPUT and click. The other windows can be selected as desired. The windows can also be selected by clicking on the icons in the menu bar at the bottom of the window.

Data for the nitrogen experiment:

Rep N Yield

1 0 0.75

1

1

1

50

100

150

4.75

10.18

10.09

2

2

2

1

2

2

200

0

50

100

150

200

11.92

0.42

6.75

9.05

11.42

11.32

3

3

3

3

3

0

50

100

150

200

0.94

5.14

7.48

10.21

11.21

To enter the data for the nitrogen experiment and analyze it, proceed with the following steps.

1. Select File: Import Data

2. Select Solutions: Analysis: Analyst

3. Select File: Open by SAS Name: Work: SASEx1

4. To correct any errors in the data

Select Edit: Mode: Edit

Any corrections can now be typed into the data table.

5. Select Statistics: ANOVA: Linear Models

A Linear Models: SASEx1 window will open (referred to as the SASEx1 window).

The variables in this experiment appear in a box on the left

Select Yield, then Dependent

Select Rep and N, then Class

6. Select Means

Select Breakdown from top bar

Select Mean, Std. Dev., Std. Error, Minimum, and Maximum

Select For Main Effects Only

Select Comparisons from top bar

Comparison Method: Waller-Duncan k-ratio t-test

Select N and Add

Select OK to return to SASEx1 window.

7. Select Titles

Type in your name and SAS Exercise 1

Select OK to return to SASEx1 window.

8. Select Plots

Select Means

Plot dependent means for main effects

Observed means

1 se

Select Residual

Plot residuals vs variables

Ordinary

Independents

Select OK to return to SASEx1 window

9. Select Statistics

Select Type I

Select OK to return to the SASEx1 window

10. Select OK to run the analysis

Analysis window will pop up with your results

Select File: Print: Entire Document: Print

Close Analysis window

11. Select from the tree on the left Means Breakdown

Select File: Print: Entire Document: Print

Close Means Breakdown window

12. Repeat for the Means Plots, Residual Plots, and Code. Printing these is not required.

13. Repeat the analysis with a new model. In the SASEx1 window:

Select N: Remove

Select N: Quantitative

Rerun the analysis. How do the results change? (Hint: check the degrees of freedom.)

14. Make sure your data table is in Edit mode. If needed, from the top bar select Edit: Mode: Edit

15. While in the data table, create a new variable N2

Select Data: Transform: Compute

Change Comp1 to N2

Double click N * N to create a formula in the box

Select OK

Use the same process to create N3 and N4

16. Rerun the analysis with Reps as a Class Variable and N, N2, N3 and N4 as Quantitative. The

Type I SS for N, N2, N3 and N4 will give you the SS linear, quadratic, cubic and quartic.

Compare this analysis with the previous analyses. Which analysis is the most appropriate for this experiment?

17. This exercise does not need to be handed in.

Download