Quick Reference for the Gamma Frailty Macro
I Data set in SAS Data Step
A. Data set must:
1. Have the following ordering of it's variable:
Time, Censoring indicator, Group number, Covariates
2. Only contain covariates wanted in the model
B. The censoring indicator needs to be specified as follows:
0 - censored; 1 - event
II Proc IML
A. User now needs to be in IML, which is done by using the statement "Proc IML
symsize=200" in the program. The symsize=200 is needed since there are a large
number of variables used in the macro.
B. Gamfrail macro is included in the program via the "%include 'filename' "
statement where 'filename' is the name of the gamma frailty macro file.
C. Parameters are defined
1. Data set parameter: name of userÕs data set
2. Variable list parameter: lists the names of the covariates, in the order
they are read into the data set
3. Initial value of the covariates parameter: The initial value of the
covariates in the independence model, should all be zeros unless the data
has been previously run through a Cox regression program.
4. Parameter defining convergence criteria for Marquardt's compromise:
This is a small number that the program will use to check for convergence.
When the estimates of the covariate parameters are within the convergence
criteria of the covariate parameters from the previous MarquardtÕs
compromise step then the covariate parameters are considered to be
converged.
5. Parameter setting the first value of the frailty parameters: this number
should be small enough (i.e. .001) so that it is very unlikely that the q that
maximizes the profile log likelihood is between it and zero. This parameter
is the first q that the program computes the profile log likelihood for after it
computes the independence model.
6. Parameter setting the increment of the change in the frailty parameter:
This is the size of the increments on q until there exists a triplet that
surrounds the value of q that maximizes the profile log likelihood.
7. Option parameter: defines which options of the six possible options the
user wants by placing a "y" for yes or a "n" for no in the position in the
position of the desired option.
Options:
(1) Print out the section of the variance-covariance matrix the only
deals with the frailty and covariate parameters.
(2) Create an output data set that contains the estimates of the frailty
and covariate parameters as well as the matrix from option(1).
(3) Print out the estimates of the baseline hazard rates and
corresponding times.
(4) Output a data set that contains the baseline hazard rates and
corresponding times.
(5) Output full variance-covariance matrix and estimates of frailty
and covariate parameter estimates as well as the baseline hazard
rates.
(6) Print out the current value of the frailty parameter, the profile log
likelihood L3, the number of times that the Wi was estimated until
convergence and the number of Marquardt Compromise iterations
for the last estimate of Wi, at each different value of the frailty
parameter until the maximum is surrounded.
8. Parameter naming the first output data set: containing the output data set
requested from option (2) above.
9. Parameter naming the second output data set: containing the output data
set requested from option (4) above.
10. Parameter naming the third output data set: containing the output data
set requested from option (5) above.
D. Macro invocation using the following statement:
%gamfrail(data set name, variable list parameter, initial value of covariates
parameter, convergence criteria parameter, parameter setting initial value of
q, parameter setting increment of change for q, options parameter,
parameter naming the first output data set, parameter naming the second
output data set, parameter naming the third output data set;
E. Contents of first output data set
1. Contains frailty and covariate parameter estimates as well as the
variance-covariance matrix with only the entries that pertain to the frailty and
covariate parameters.
a. First column contains the estimates
(1) First row is the frailty parameter
(2) Next p rows are the covariate parameter estimates
b. Next p+1 columns contain the variance-covariance matrix
(1) First row contains the covariances with respect to the
frailty parameter.
(2) Second row contains the covariances with respect to
covariate 1.
.
.
.
(p+1) p+1st row contains the covariances with respect to
covariate p.
F. Contents of the second output data set
1. Contains estimates of the baseline hazard rates as well as the
corresponding times
a. First column is time
b. Second column contains the respective baseline hazard rates
G. Contents of the third output data set.
1. Contains the estimates of frailty and covariate parameters, baseline
hazard rates and the full variance-covariance matrix.
a. First column contains the estimates.
(1) First row is the estimate of the frailty parameter
(2) Next p rows are estimates of covariate parameters
(3) Last D rows are estimates of baseline hazard rates.
b. The rest of the columns are the full variance-covariance matrix
(1) First row contains the covariances with respect to q
(2) Next p rows contain covariances with respect to the
respective covariate parameter
(A) The first of these rows is with respect to
covariate 1
(B) The second of these rows is with respect to
covariate 2
.
.
.
(p) The pth of these rows is with respect to covariate p
(3) Last D rows contain the covariances with respect to the
baseline hazard rate.
(A) The first of these rows is with respect to the
largest event time
(B) The second of these rows is with respect to the
second largest event time
.
.
.
(D) The last of these rows is with respect to the
smallest event time