Chapter Contents |
Previous |
Next |
The SURVEYREG Procedure |
Grade | Number of Students |
7 | 1,824 |
8 | 1,025 |
3 | 1,151 |
Total | 4,000 |
In order to analyze this sample using PROC SURVEYREG, you need to input the stratification information by creating a SAS data set for Table 62.1. The following SAS statements create a data set called StudentTotal.
data StudentTotal; input Grade _TOTAL_; datalines; 7 1824 8 1025 9 1151 ;
The variable Grade is the stratification variable, and the variable _TOTAL_ contains the total numbers of students in the strata in the survey population. PROC SURVEYREG requires you to use the keyword _TOTAL_ as the name of the variable that contains the population total information.
The following statements demonstrate how you can fit the linear model while incorporating the sample design information (stratification).
title1 'Ice Cream Spending Analysis'; title2 'Stratified Simple Random Sampling Design'; proc surveyreg data=IceCream total=StudentTotal; strata Grade /list; class Kids; model Spending = Income Kids / solution; run;
By comparing these statements to those in the section "Simple Random Sampling", the TOTAL=StudentTotal option replaces the previous TOTAL=4000 option. When the population totals and sample sizes differ among strata, the population totals must be provided by a data set.
The STRATA statement specifies the stratification variable Grade. The LIST option in the STRATA statement requests that the stratification information be included in the output.
Figure 62.4 summarizes the data information, the sample design information, and the fit information. Note that, due to the stratification, the denominator degrees of freedom for F tests and t tests is 37, which is different from the analysis in Figure 62.1.
|
Figure 62.5 displays the identifications of strata, numbers of observations or sample sizes in strata, total numbers of students in strata, and calculated sampling rates or sampling fractions in strata.
|
Figure 62.6 displays the ANOVA table for the regression and the tests for the significance of model effects under the stratified sample design. The income effect is significant, while the kids effect is not significant at the 5% level.
|
The regression coefficient estimates for the stratified sample are displayed in Figure 62.7. The standard errors of the estimates and associated t tests are also shown in this table.
You can request other statistics and tests using PROC SURVEYREG. You can also analyze data from a more complex sample design. The remainder of this chapter provides more detailed information.
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.