The CAUSALMED Procedure

WEIGHT Statement

  • WEIGHT variable;

If you want to use relative weights for each observation in the input data set, then specify a variable that contains weights in a WEIGHT statement. This is often done when the variance that is associated with each observation is different and the values of the weight variable are proportional to the reciprocals of the variances.

If an observation has a negative or missing weight, it is excluded from the analysis. Otherwise, observations that have nonnegative weights are included in the analysis. The weights affect the computations in two ways. One way is in the computation of means and standard deviations of continuous variables. The other way is in the fitting of generalized linear models for the mediator and outcome variables.

The computation of weighted means and standard deviations by PROC CAUSALMED is consistent with that of PROC MEANS when nonpositive weights are excluded (that is, by using the EXCLNPWGT option in PROC MEANS). For nonnegative weight values w Subscript i, the formulas for computing the weighted mean and standard deviation are

StartLayout 1st Row 1st Column x overbar Subscript w 2nd Column equals 3rd Column sigma-summation Underscript i equals 1 Overscript n Endscripts w Subscript i Baseline x Subscript i slash sigma-summation Underscript i equals 1 Overscript n Endscripts w Subscript i 2nd Row 1st Column ModifyingAbove sigma With caret Subscript w 2nd Column equals 3rd Column StartRoot sigma-summation Underscript i equals 1 Overscript n Endscripts w Subscript i Baseline left-parenthesis x Subscript i Baseline minus x overbar Subscript w Baseline right-parenthesis squared slash d EndRoot EndLayout

where x Subscript i is a variable value, n is the total number of observations, and d is the variance divisor that is defined by the VARDEF= option. By default, VARDEF=DF, so d is n minus 1.

The weights are also used in fitting generalized linear models. For more information about how the weights are used in model fitting, see the WEIGHT statement in ChapterĀ 51, The GENMOD Procedure.

Last updated: December 09, 2022