hemreg | Extract H and E matrices for multivariate regression | hemreg |
The HEMREG macro extracts hypothesis (H) and error (E) matrices for an
overall test in a multivariate regression analysis, in a form similar to
that provided by the OUTSTAT=
option with PROC GLM. This is typically
used with the HEPLOT macro, or the MPOWER macro for MMRA.
For a multivariate regression analysis, using
proc glm outstat=stats; model y1 y2 y3 = x1-x5;
PROC GLM will produce 5 separate 3x3, 1 df SSCP matrices for the separate
predictors X1-X5, in the OUTSTAT=
data set, but no SSCP matrix for
the overall multivariate test. The HEMREG macro uses PROC REG instead,
obtains the HypothesisSSCP and ErrorSSCP tables using ODS, and massages
these into the same format used by PROC GLM.
The HEMREG macro is defined with keyword parameters. The Y=
and
X=
parameters are required. One or more overall hypotheses involving
subsets of the X=
variables may be specified with the MTEST=
parameter.
The arguments may be listed within parentheses in any order, separated
by commas. For example:
%hemreg(y=SAT PPVT RAVEN, x=N S NS NA SS); %hemreg(y=SAT PPVT RAVEN, x=N S NS NA SS, mtest=%str(N,S,NS), hyp=N:S:NS);
DATA=_LAST_
]
test(s)
specified in the MTEST=
parameter (to be used as
the EFFECT=
parameter in the HEPLOT macro). [Default: HYP=H1
]
MTEST=
is not specified (the default), a multivariate test
of all X=
predictors is carried out, giving an overall H matrix.
Otherwise, MTEST=
can specify one or more multivariate tests of
subsets of the predictors, separated by '/', where the variables
within each subset are separated by ','. In this case, the embedded
','s must be protected by surrounting the parameter value in
%str()
. For example,
MTEST = %str(group / x1, x2, x3 / x4, x5)
In this case you might specify HYP=Group X1:X3 X4:X5
to name
the H matrices.
SS=SS2
,
the _TYPE_ variable in the output data set is changed to
_TYPE_='SS3'
to conform with PROC GLM. [Default: SS=SS2
]
OUT=HE
]
%include macros(hemreg); *-- or include in an autocall library; %include data(lo_ses); %hemreg(data=lo_ses, y=SAT PPVT RAVEN, x=N S NS NA SS, out=he);The output is
_NAME_ _source_ _type_ SAT PPVT RAVEN DF SAT H1 SS3 3653.773237 2159.9966058 63.36802958 5 PPVT H1 SS3 2159.9966058 2883.675904 281.48417619 5 RAVEN H1 SS3 63.36802958 281.48417619 76.528604456 5 SAT ERROR ERROR 13929.52406 1530.5169077 457.19953799 31 PPVT ERROR ERROR 1530.5169077 2764.7565284 213.67798597 31 RAVEN ERROR ERROR 457.19953799 213.67798597 268.28220636 31