This example illustrates the ability of PROC CATMOD to operate on an existing vector of functions and the corresponding covariance matrix. The estimates under investigation are composite indices summarizing the responses to 18 psychological questions pertaining to general well-being. These estimates are computed for domains corresponding to an age-by-sex cross-classification, and the covariance matrix is calculated using the method of balanced repeated replications. The analysis is directed at obtaining a description of the variation among these domain estimates. The data are from Koch and Stokes (1979).
In the following statements, the first row of the fbeing
data set contains the response functions for the variables b1
–b10
, while the remaining rows contain the covariance matrix. From the PROC CATMOD statements, the READ option in the RESPONSE statement says that you are inputting the response functions and their covariance matrix, while the PROFILE= option in the FACTORS statement tells you that the variables b1
–b5
correspond to the effects for sex
='male' at the five different age groupings, and b6
–b10
likewise correspond to the effects for sex
='female'. See the section Inputting Response Functions and Covariances Directly for more information about using the READ option.
data fbeing(type=est); input b1-b5 _type_ $ _name_ $ b6-b10 #2; datalines; 7.93726 7.92509 7.82815 7.73696 8.16791 parms . 7.24978 7.18991 7.35960 7.31937 7.55184 0.00739 0.00019 0.00146 -0.00082 0.00076 cov b1 0.00189 0.00118 0.00140 -0.00140 0.00039 0.00019 0.01172 0.00183 0.00029 0.00083 cov b2 -0.00123 -0.00629 -0.00088 -0.00232 0.00034 0.00146 0.00183 0.01050 -0.00173 0.00011 cov b3 0.00434 -0.00059 -0.00055 0.00023 -0.00013 -0.00082 0.00029 -0.00173 0.01335 0.00140 cov b4 0.00158 0.00212 0.00211 0.00066 0.00240 0.00076 0.00083 0.00011 0.00140 0.01430 cov b5 -0.00050 -0.00098 0.00239 -0.00010 0.00213 0.00189 -0.00123 0.00434 0.00158 -0.00050 cov b6 0.01110 0.00101 0.00177 -0.00018 -0.00082 0.00118 -0.00629 -0.00059 0.00212 -0.00098 cov b7 0.00101 0.02342 0.00144 0.00369 0.00253 0.00140 -0.00088 -0.00055 0.00211 0.00239 cov b8 0.00177 0.00144 0.01060 0.00157 0.00226 -0.00140 -0.00232 0.00023 0.00066 -0.00010 cov b9 -0.00018 0.00369 0.00157 0.02298 0.00918 0.00039 0.00034 -0.00013 0.00240 0.00213 cov b10 -0.00082 0.00253 0.00226 0.00918 0.01921 ;
The following statements produce Output 32.10.1:
proc catmod data=fbeing; title 'Complex Sample Survey Analysis'; response read b1-b10; factors sex $ 2, age $ 5 / _response_=sex age profile=(male '25-34', male '35-44', male '45-54', male '55-64', male '65-74', female '25-34', female '35-44', female '45-54', female '55-64', female '65-74'); model _f_=_response_ / design title='Main Effects for Sex and Age'; run;
Output 32.10.1: Health Survey Data: Using Direct Input
Complex Sample Survey Analysis |
Response Functions and Design Matrix | ||||||||
---|---|---|---|---|---|---|---|---|
Sample | Function Number |
Response Function |
Design Matrix | |||||
1 | 2 | 3 | 4 | 5 | 6 | |||
1 | 1 | 7.93726 | 1 | 1 | 1 | 0 | 0 | 0 |
2 | 7.92509 | 1 | 1 | 0 | 1 | 0 | 0 | |
3 | 7.82815 | 1 | 1 | 0 | 0 | 1 | 0 | |
4 | 7.73696 | 1 | 1 | 0 | 0 | 0 | 1 | |
5 | 8.16791 | 1 | 1 | -1 | -1 | -1 | -1 | |
6 | 7.24978 | 1 | -1 | 1 | 0 | 0 | 0 | |
7 | 7.18991 | 1 | -1 | 0 | 1 | 0 | 0 | |
8 | 7.35960 | 1 | -1 | 0 | 0 | 1 | 0 | |
9 | 7.31937 | 1 | -1 | 0 | 0 | 0 | 1 | |
10 | 7.55184 | 1 | -1 | -1 | -1 | -1 | -1 |
Analysis of Variance | |||
---|---|---|---|
Source | DF | Chi-Square | Pr > ChiSq |
Intercept | 1 | 28089.07 | <.0001 |
sex | 1 | 65.84 | <.0001 |
age | 4 | 9.21 | 0.0561 |
Residual | 4 | 2.92 | 0.5713 |
Analysis of Weighted Least Squares Estimates | |||||
---|---|---|---|---|---|
Effect | Parameter | Estimate | Standard Error |
Chi- Square |
Pr > ChiSq |
Intercept | 1 | 7.6319 | 0.0455 | 28089.07 | <.0001 |
sex | 2 | 0.2900 | 0.0357 | 65.84 | <.0001 |
age | 3 | -0.00780 | 0.0645 | 0.01 | 0.9037 |
4 | -0.0465 | 0.0636 | 0.54 | 0.4642 | |
5 | -0.0343 | 0.0557 | 0.38 | 0.5387 | |
6 | -0.1098 | 0.0764 | 2.07 | 0.1506 |
The analysis of variance table in Output 32.10.1 shows that the additive model fits and that there is a significant effect of both sex and age. The following statements produce Output 32.10.2:
contrast 'No Age Effect for Age<65' all_parms 0 0 1 0 0 -1, all_parms 0 0 0 1 0 -1, all_parms 0 0 0 0 1 -1; run;
The analysis of the contrast shows that there is no significant difference among the four age groups that are under age 65.
Output 32.10.2: Health Survey Data: Age<65 Contrast
Complex Sample Survey Analysis |
Analysis of Contrasts | |||
---|---|---|---|
Contrast | DF | Chi-Square | Pr > ChiSq |
No Age Effect for Age<65 | 3 | 0.72 | 0.8678 |
The next model contains a binary age effect (under 65 versus 65 and over). The following statements produce Output 32.10.3:
model _f_=(1 1 1, 1 1 1, 1 1 1, 1 1 1, 1 1 -1, 1 -1 1, 1 -1 1, 1 -1 1, 1 -1 1, 1 -1 -1) (1='Intercept' , 2='Sex' , 3='Age (25-64 vs. 65-74)') / design title='Binary Age Effect (25-64 vs. 65-74)' ; run; quit;
Output 32.10.3: Health Survey Data: Age<65 Model
Complex Sample Survey Analysis |
Response Functions and Design Matrix | |||||
---|---|---|---|---|---|
Sample | Function Number |
Response Function |
Design Matrix | ||
1 | 2 | 3 | |||
1 | 1 | 7.93726 | 1 | 1 | 1 |
2 | 7.92509 | 1 | 1 | 1 | |
3 | 7.82815 | 1 | 1 | 1 | |
4 | 7.73696 | 1 | 1 | 1 | |
5 | 8.16791 | 1 | 1 | -1 | |
6 | 7.24978 | 1 | -1 | 1 | |
7 | 7.18991 | 1 | -1 | 1 | |
8 | 7.35960 | 1 | -1 | 1 | |
9 | 7.31937 | 1 | -1 | 1 | |
10 | 7.55184 | 1 | -1 | -1 |
Analysis of Variance | |||
---|---|---|---|
Source | DF | Chi-Square | Pr > ChiSq |
Intercept | 1 | 19087.16 | <.0001 |
Sex | 1 | 72.64 | <.0001 |
Age (25-64 vs. 65-74) | 1 | 8.49 | 0.0036 |
Residual | 7 | 3.64 | 0.8198 |
Analysis of Weighted Least Squares Estimates | |||||
---|---|---|---|---|---|
Effect | Parameter | Estimate | Standard Error |
Chi- Square |
Pr > ChiSq |
Model | 1 | 7.7183 | 0.0559 | 19087.16 | <.0001 |
2 | 0.2800 | 0.0329 | 72.64 | <.0001 | |
3 | -0.1304 | 0.0448 | 8.49 | 0.0036 |
The analysis of variance table in Output 32.10.3 shows that the model fits (note that the goodness-of-fit statistic is the sum of the previous one (Output 32.10.1) plus the chi-square for the contrast matrix in Output 32.10.2). The age and sex effects are significant. Since the second parameter in the table of estimates is positive, males (the first level for the sex variable) have a higher predicted index of well-being than females. Since the third parameter estimate is negative, those younger than age 65 (the first level of age) have a lower predicted index of well-being than those 65 and older.