Software for Performing Small Sample Adjustments to Wald Types Tests
with Sandwich Estimators
The main function is called saws .
It inputs:
-
beta = p by 1 matrix or vector of parameter estimates
-
u = k by p matrix of quasi-score functions
-
omega=k by p by p array of infomation matrices
-
test=a vector of indices of parameters that you wish to test (default is
all parameters: test=1:p)
-
alpha=significance level (default: alpha=.05)
-
output = 0,1, or 2
0 - only output recommended test (Sandwich
using F distn with degrees of freedom=1, d.tilde.no.H)
1 - (default) output Model based, Standard
Sandwich and Sandwich using F distn with degrees of freedom=1, d.tilde.no.H
2 - output all tests
It outputs:
-
a list of matrices with parameter estimates, confidence
limits, degrees of freedom estimates, and 2-sided p-values. There
are 8 different output matrices (see output for which ones are produced):
-
Vm.Chi2 = Model-based variance used with Chi square distribution
with 1 degree of freedom
-
Vs.Chi2 = Standard sandwich variance used with Chi square
distribution with 1 degree of freedom
-
Vs.F.K.minus.p = Standard sandwich variance used with an F distn with 1
and K-p degrees of freedom
-
Vs.F.d.tilde.no.H = Standard sandwich variance used with an F distn with
1 and d.tilde degrees of freedom (see paper, this is the recommended default).
-
Vs.F.d.hat.no.H = Standard sandwich variance used with an F distn with
1 and d.hat degrees of freedom (see paper).
-
Va.Chi2 = Adjusted sandwich variance used with Chi square distribution
with 1 degree of freedom
-
Va.F.d.tilde.with.H = Adjusted sandwich variance used with an F distn with
1 and d.tilde_H degrees of freedom (see paper).
-
Va.F.d.hat.with.H = Adjusted sandwich variance used with an F distn with
1 and d.hat_H degrees of freedom (see paper).
Because most splus functions output beta, but not the u or omega values,
we must make modifications to existing programs so that they will output
these values. We give 3 examples:
-
Generalized Estimating Equations
-
Conditional Logistic Regression
-
Cox Proportional Hazards Models
Generalized Estimating Equations
I have made some modifications version 1.5.1.2 of
the YAGS software by VJ Carey that I obtained from http://biosun1.harvard.edu/~carey/index.ssoft.html
The
yags software is under the GNU General Public License,
therefore all my modifications are under the same license. The complete
yags software is a group of many functions. I have modified only the following:
-
yags modified to myags (The modification is to
change an internal call from yags.pmat.fit to myags.pmat.fit)
-
yags.pmat.fit modified to myags.pmat.fit(added
code to output the matrix u (quasi-scores) and the array omega
(information matrices) for input into the saws function)
-
modified the LZ.exchalp function to another function called LZ.exchalp.
(This modification bounds the exchangeable correlation similar as is done
in SAS PROC GENMOD, SAS personal communication. It leads to better convergence
in some situations; see Notes and Data Examples ).
Conditional Logistic Regression
I have translated Doug Midthune's Fortran function
for conditional logistic regression (PC
executible and Fortran code) , based on the work of Gail, Lubin and
Rubnstein (1981) into Splus. These Splus
functions output beta, u, and omega for input into the saws function.
Cox Proportional Hazards Model
I wrote a function, mcoxph,
which through repeated calls to coxph outputs beta, u, and omega for input
into the saws function. This function does not work correctly when called
from inside another function.
Return to SAWS homepage