Chapter Contents |
Previous |
Next |
Using the Output Delivery System |
The data set comes from a preclinical drug experiment (Cole and Grizzle 1966). In order to study the effect of two different drugs on histamine levels in the blood, researchers administer the drugs to 13 animals, and the levels of histamine in the animals' blood is measured after 0, 1, 3, and 5 minutes. The response variable is the logarithm of the histamine level. The following statements create a SAS data set named Histamine that contains the experimental data.
title1 "Histamine Study"; data Histamine; input Drug $12. Depleted $ hist0 hist1 hist3 hist5; logHist0 = log(hist0); logHist1 = log(Hist1); logHist3 = log(hist3); logHist5 = log(Hist5); datalines; Morphine N .04 .20 .10 .08 Morphine N .02 .06 .02 .02 Morphine N .07 1.40 .48 .24 Morphine N .17 .57 .35 .24 Morphine Y .10 .09 .13 .14 Morphine Y .07 .07 .06 .07 Morphine Y .05 .07 .06 .07 Trimethaphan N .03 .62 .31 .22 Trimethaphan N .03 1.05 .73 .60 Trimethaphan N .07 .83 1.07 .80 Trimethaphan N .09 3.13 2.06 1.23 Trimethaphan Y .10 .09 .09 .08 Trimethaphan Y .08 .09 .09 .10 Trimethaphan Y .13 .10 .12 .12 Trimethaphan Y .06 .05 .05 .05 ;
In the analysis that follows, the GLM procedure is invoked to perform a repeated measures analysis, naming the drug and depletion status as between-subject factors in the MODEL statement and naming post-administration measurement time as the within-subject factor (for more information on this study and its analysis, see Example 7 in Chapter 30, "The GLM Procedure").
The following ODS statement requests that two ODS tables be written to SAS data sets called HistWithin and HistBetween. The SAS listing is closed so that no output is displayed. The GLM procedure is invoked and the model is fit.
ods output MultStat = HistWithin BetweenSubjects.ModelANOVA = HistBetween; ods listing close; proc glm data=Histamine; class Drug Depleted; model LogHist0--LogHist5 = Drug Depleted Drug*Depleted / nouni; repeated Time 4 (0 1 3 5) polynomial / summary printe; run; quit;
All of the multivariate test results appear in the HistWithin data set. This is because all multivariate test tables are named "MultStat," although they occur in different directories in the output directory hierarchy.
Note that, even though there are also other tables named "ModelANOVA," the preceding ODS OUTPUT statement ensures that only the between-subject ANOVA appears in the HistBetween data set. The specific table is selected because of the additional specification of the partial path ("BetweenSubjects") in which it occurs. For more information on names and qualified path names, see the discussion in the section "Using the Output Delivery System".
In the following statements, a new data set, temp1, is created to contain the two data sets output in the preceding GLM run. They are displayed with no further processing.
ods listing; title2 'Listing of Raw Data Sets'; data temp1; set HistBetween HistWithin; run; proc print; run;Output 15.10.1: Listing of the Raw Data Sets: Histamine Study
|
data HistTests; set HistBetween(where =(Source ^= "Error")) HistWithin (rename=(Hypothesis = Source NumDF=DF) where =(Statistic = "Hotelling-Lawley Trace")); run; proc print ; title2 'Listing of Selections from the Raw Data Sets'; run;Output 15.10.2: Listing of Selections from the Raw Data Sets: Histamine Study
|
You can use the 'Stat.GLM.Tests' template to display the SAS data set HistTests, as follows:
data _null_ ; title2 'Listing of the Selections, Using a Standard Template'; set HistTests; file print ods=(template='Stat.GLM.Tests'); put _ods_; run;
The ODS= option in the FILE statement enables you to use the DATA step to display a data set as a table. You do this by specifying data columns and associated attributes, such as the template specification.
The PUT statement contains the _ODS_ keyword. The keyword instructs the PUT statement to send the data values for all columns (as defined in the ODS= option in the FILE statement) to the open ODS destinations. For more information on using ODS in the DATA step, refer to The Complete Guide to the SAS Output Delivery System.
Output 15.10.3: Listing of the Data Sets Using a Standard Template
|
For detailed information on using the TEMPLATE procedure, refer to the chapter titled "The Template Procedure" in The Complete Guide to the SAS Output Delivery System.
proc template; define table CombinedTests; parent=Stat.GLM.Tests; header "#Histamine Study##"; footer "#* - Test computed using Hotelling-Lawley trace"; column Source DF SS MS FValue ProbF Star; define SS; parent = Stat.GLM.SS; format = D7.3; translate _val_ = . into ' *'; end; define MS; parent = Stat.GLM.MS; format = D7.3; translate _val_ = . into ' *'; end; define Star; compute as ProbF; translate _val_ > 0.05 into "", _val_ > 0.01 into "*", _val_ > 0.001 into "**", _val_ <= 0.001 into "***"; pre_space=1 width=3 just=l; end; end; run;
The Dw.s format, used in the preceding statements to redefine the SS and Mean Square columns, writes numbers in similar ranges with the same number of decimal places. In the format specification, w represents the width of the field and s represents the number of significant digits. Refer to the chapter on formats in SAS Language Reference: Dictionary for detailed information.
The following statements display the HistTests data set using the customized template. The results are displayed in Output 15.10.4.
data _null_; title2 'Listing of the Selections, Using a Customized Template'; set HistTests; file print ods=(template='CombinedTests'); put _ods_; run;Output 15.10.4: Listing of the Data Sets Using a Customized Template: Histamine Study
|
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.