Obsidian | Level 7

## Estimate Statement explanation for PROC GENMODE

I am trying to understand the model implementation to estimate the adjusted relative risk using PROC GENMOD.

The SAS technical document (https://support.sas.com/resources/papers/proceedings11/345-2011.pdf)  has the following code snippet:

Proc GenMod data=StudyCohort descending;
Class SPC/param=ref ref=first;
Model Death_1year=SPC Var_1- Var_n / Dist=bin Link=log;
Estimate 'RR SPC vs. Non-SPC' SPC 1/exp;
Run;

The Estimate statement is where I am running into trouble. All the available example and SAS documentation provide examples comparing between two groups. e.g.: this is from the SAS documents (http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_introcom_sec...),

```estimate 'B at A2' b 1 -1 a*b 0  0  1 -1      ;
estimate 'B at A2' b 1 -1 a*b [1 2 1] [-1 2 2];```

now, the first line is conforming to positional formatting while the second line is following the nonpositional syntax.

however, another variation of estimate statement (also available on SAS doc, http://support.sas.com/kb/24/447.html😞

The ESTIMATE statement syntax enables you to specify the coefficient vector in sections as just described, with one section for each model effect:

```   estimate 'AB12' intercept 1
a 1 0 0 0 0
b 0 1
a*b 0 1 0 0 0 0 0 0 0 0;```

Using the similarity between CONTRASTS and ESTIMATE, I could follow the logic of maintaining the positional consistency and how they correspond to the specific coefficient. However, I am not very clear on "Estimate 'RR SPC vs. Non-SPC' SPC 1/exp;" -- what is meant by "1"  for the SPC ( which is the effect variable). In the documents, there are two levels (0, 1) for SPC, of which the reference level is 0. This led me to assume that, there is actually 2-1 = 1 indicator variable for that comparison. And "1" is for that parameter.  However, why it is not  (0 1) as were presented in the other SAS documents or why intercept (1) is not included in the model -- I was not able to follow clearly. If someone can provide some explanation, that would be helpful.

1 ACCEPTED SOLUTION

Accepted Solutions
SAS Super FREQ

## Re: Estimate Statement explanation for PROC GENMODE

The ESTIMATE statement estimates and tests the vector product L'Beta. The numbers in the ESTIMATE statement multiply of the corresponding parameters - they are the L vector. Beta, of course, are the parameter estimates. With reference parameterization (PARAM=REF), a binary variable has only a single parameter estimate in the results, so the "1" simply multiplies that parameter estimate and the ESTIMATE statement with the EXP option then provides the estimate (same as the parameter estimate in this case) and the exponentiated estimate (exp(Beta)). The other examples of the ESTIMATE statement that you cite deal with models containing interaction effects. The L vector needed to test a particular hypothesis, such as the effect of A in a given level of B, becomes more complex than the simplest case of a binary predictor not involved in interaction.

2 REPLIES 2
SAS Super FREQ

## Re: Estimate Statement explanation for PROC GENMODE

The ESTIMATE statement estimates and tests the vector product L'Beta. The numbers in the ESTIMATE statement multiply of the corresponding parameters - they are the L vector. Beta, of course, are the parameter estimates. With reference parameterization (PARAM=REF), a binary variable has only a single parameter estimate in the results, so the "1" simply multiplies that parameter estimate and the ESTIMATE statement with the EXP option then provides the estimate (same as the parameter estimate in this case) and the exponentiated estimate (exp(Beta)). The other examples of the ESTIMATE statement that you cite deal with models containing interaction effects. The L vector needed to test a particular hypothesis, such as the effect of A in a given level of B, becomes more complex than the simplest case of a binary predictor not involved in interaction.

Obsidian | Level 7

## Re: Estimate Statement explanation for PROC GENMODE

Thank you for giving a clear explanation!

Discussion stats
• 2 replies
• 1723 views
• 3 likes
• 2 in conversation