03-20-2025
MichaelL_SAS
SAS Employee
Member since
01-21-2019
- 99 Posts
- 19 Likes Given
- 31 Solutions
- 107 Likes Received
-
Latest posts by MichaelL_SAS
Subject Views Posted 1067 05-14-2024 04:05 PM 896 03-11-2024 10:52 AM 726 08-15-2023 12:42 PM 1519 08-10-2023 03:43 PM 771 03-23-2023 05:20 PM 3208 01-26-2023 11:50 AM 1397 01-10-2023 03:03 PM 1589 07-29-2022 09:51 AM 3004 06-22-2022 05:07 PM 2892 06-22-2022 11:46 AM -
Activity Feed for MichaelL_SAS
- Posted Re: proc causaltrt and stabilized ipw weights on Statistical Procedures. 05-14-2024 04:05 PM
- Got a Like for Re: PS 1 to 5 Optimal Matching. 03-19-2024 03:13 PM
- Posted Re: PS 1 to 5 Optimal Matching on Statistical Procedures. 03-11-2024 10:52 AM
- Posted Re: proc psmatch on Statistical Procedures. 08-15-2023 12:42 PM
- Got a Like for Re: Log-binomial with GEE regression. 08-11-2023 01:59 PM
- Got a Like for Re: Log-binomial with GEE regression. 08-11-2023 08:46 AM
- Posted Re: Log-binomial with GEE regression on Statistical Procedures. 08-10-2023 03:43 PM
- Got a Like for Re: proc psmatch matching order?. 03-27-2023 07:51 AM
- Posted Re: proc psmatch matching order? on Statistical Procedures. 03-23-2023 05:20 PM
- Got a Like for Re: PHREG natural cubic spline - what is the fitted function?. 01-28-2023 09:39 AM
- Got a Like for Re: PHREG natural cubic spline - what is the fitted function?. 01-26-2023 12:23 PM
- Posted Re: PHREG natural cubic spline - what is the fitted function? on Statistical Procedures. 01-26-2023 11:50 AM
- Posted Re: Calculation of type I sum of squares for a ZIP model in SAS on Statistical Procedures. 01-10-2023 03:03 PM
- Got a Like for Re: Hazards ratio in PROC CAUSALMED. 11-29-2022 03:27 PM
- Posted Re: ERROR in proc PSMATCH: The support region does not exist. on Statistical Procedures. 07-29-2022 09:51 AM
- Liked Re: PROC PSMATCH/ASSESS statement not recognizing a binary variable as binary for Kelly_K. 06-23-2022 01:11 PM
- Got a Like for Re: PROC PSMATCH/ASSESS statement not recognizing a binary variable as binary. 06-23-2022 12:40 PM
- Posted Re: Simulation of a variable (continuous or dichotomous) correlated to three existant variables? on Statistical Procedures. 06-22-2022 05:07 PM
- Posted Re: PROC PSMATCH/ASSESS statement not recognizing a binary variable as binary on Statistical Procedures. 06-22-2022 11:46 AM
- Got a Like for Re: Simulation of a variable (continuous or dichotomous) correlated to three existant variables?. 06-16-2022 05:21 PM
-
Posts I Liked
Subject Likes Author Latest Post 2 3 1 1 1 -
My Liked Posts
Subject Likes Posted 1 03-11-2024 10:52 AM 3 08-10-2023 03:43 PM 1 03-23-2023 05:20 PM 3 01-26-2023 11:50 AM 1 06-22-2022 11:46 AM
06-29-2020
09:31 AM
As described in the CALIPER= syntax section of the PROC PSMATCH documentation, specifying "CALIPER=." requests no caliper constraint be applied to the matching problem. Specifying CALIPER=. is different then not specifying the CALIPER= option, in which case you are correct CALIPER=0.25 would be used as the default.
... View more
06-23-2020
08:23 PM
3 Likes
Maybe one point to clarify, ordinal variables are not supported in the ASSESS statement in PROC PSMATCH (since many of the balance diagnostics consider mean differences), but they can be used in the other statements. In your example you could use the variable THAanesth in the PSMODEL statement and the binary level indicators you created could be used in the ASSESS statement. However in that case assessing the balance achieved for the variable THAanesth requires judging the balance achieved for all of the binary level indicators. Another option for assessing the balance for a categorical variable is to create an output data set of the matched data and then use PROC FREQ to request a contingency table of the variable and the treatment. That approach is illustrated in Example 1 of this recent SAS Global Forum paper.
... View more
06-16-2020
11:07 AM
3 Likes
Since I’m not familiar with the data for your example and the subject area I don’t want to comment specifically on it, but let me try a more general answer to your question. The natural indirect effect is interpreted as the effect the treatment has on the outcome through its effect on the mediator variable. So in the situation where the outcome is the risk of an event occurring, a negative NIE and positive NDE indicates (assuming all the necessary assumptions are satisfied) that the treatment’s effect on the mediator leads to a decreased risk of the outcome occurring, but the effect of treatment on the outcome through any remaining pathways (not through the mediator) increases the risk of the outcome occurring. One way this might occur is if the treatment has a positive effect on the outcome (directly), the mediator also has a positive effect on the outcome, but the treatment has a negative effect on the mediator leading to a negative NIE. Also, in some situations, it might be the case that both the NIE and NDE are significant, but the overall total effect is not. A formal definition of these effects in a counterfactual framework is provided in the “Conterfactual Framework for Defining Causal Mediation Effects” section of the PROC CAUSALMED documentation.
... View more
06-11-2020
11:58 AM
3 Likes
I assume that you are refereeing to the percentages reported in the “Percentage Decomposition of the Total Effect” table requested by the DECOMP option. Negative percentages for the natural direct effect (NDE) and natural indirect effect (NIE) can be reported when the NIE and NDE have opposite signs. Based on the total effect (TE) decomposition, TE = NDE + NIE, the combined percentages reported for the NDE and NIE should equal 100%. In your case it sounds like the NDE is larger than the total effect, so the NDE percentage, NDE/TE*100% results in a value greater than 100%, and therefore a negative NIE percentage is reported. In this type of situation these proportion measures for the NIE and NDE are less meaningful.
... View more
05-29-2020
08:48 PM
1 Like
One small comment, I believe PROC GEE does support Type III tests for generalized logit models using the Wald test statistic, and it supports Type III tests using either the generalized score statistic or the Wald test statistic for ordinal response models. To request the Wald tests you can specify the Wald option in the MODEL statement.
... View more
05-21-2020
08:02 PM
1 Like
Thanks for providing the example code, it makes diagnosing and describing what's going on much easier.
In the code you provided no plot-request sub-option specified, and the note you see in the log indicates that no plots are produced unless a plot-request is specified. The description of the PLOTS= option in the PROC CORR documentation includes a description of the possible plot-request options you can make. The example code below should produce all of the appropriate plots:
proc corr data=hotel.Hotel_bookings plots(MAXPOINTS=NONE)=all;
var booking_changes adr;
run;
... View more
05-08-2020
11:17 AM
You were quicker than I was in catching my mistake and editing the post. PROC CORR also has both of these options.
... View more
05-08-2020
11:12 AM
2 Likes
I see this has an accepted solution, but I'll just comment that if all you want is information about the largest correlation coefficients you can use the RANK option in the PROC CORR statement to request the correlation coefficients be displayed in order from highest to lowest absolute value, or the BEST=n option which requests an ordered display of only the n largest correlation coefficients for each variable. In both these cases, each column of the display no longer corresponds to the same variable, but instead is the "Bestn" variable that gives the nth largest correlation coefficient for that row variable.
... View more
05-08-2020
10:56 AM
1 Like
The "Parameter Estimate Covariances" section of the PROC GENMOD documentation describes the formulas for the model and empirical covariance matrix estimates.
The model based estimate is the inverse of the generalized Hessian used in the GEE fitting algorithm. The empirical, or robust, covariance is a "sandwich" estimator that uses the inverse of the generalized Hessian as the "bread" and the outer product of the score functions as the "meat".
The empirical estimate is the default because it is robust to misspecification of the working correlation structure, in particular it provides a consistent estimate for the covariance matrix even when the working correlation structure is misspecified. In general, the model based covariance matrix only provides a consistent estimate when the working correlation structure is correctly specified.
One point to keep in mind when using the empirical covariance estimate is that when there are a small number of clusters or subjects in the data, it can tend to underestimate standard errors leading to more liberal tests and confidence intervals.
... View more
05-05-2020
11:53 AM
3 Likes
@emaguin , to answer your question about how the the correlated dependent variables enter into the estimation of the coefficients, the main source would be in the "generalized Hessian" used in the update step (step 4) of the GEE fitting algorithm described here in the PROC GENMOD documentation. That expression is something like a "weighted" X'X computation, where components of a design row are "weighted" based on the partial derivatives of the link function and also the inverse working covariance matrix for the response variable.
To your question about why the model converges with some working correlation structures and not others that is hard to say without the data. Based on your description I doubt this is the cause (I mention it here in case someone in the future comes across this thread) but sometimes a model with an exchangeable working correlation structure results in a NPD generalized Hessian due to insufficient variability in the outcome variable within subjects/clusters. This can result in an estimate for the working correlation matrix that is near singular, which then effects the computation of the generalized Hessian. Very often a give away for this type of issue is a some notes in the log about having to ridge the estimate for the working correlation matrix before the error about the NPD generalized Hessian.
... View more
04-30-2020
10:05 AM
Hmm, not what I would have expected. If this issue persists, I'd recommend possibly reaching out to SAS Technical Support to see if they can help resolve the issue. For this type of problem I suspect they'd likely ask if you can share the data with them since it is tricky problem to diagnose.
That said I would also second @SteveDenham suggestion of trying to match on precomputed propensity scores as demonstrated in Example 98.8 of the PROC PSMATCH documentation. You can see if PROC LOGISTIC provides any additional information about possible issues with fitting the model or maybe if it helps resolve the issue.
I believe there was a bug in PROC PSMATCH fixed in SAS/STAT 15.1 where observations that had missing values for variables listed in the ASSESS statement but not the PSMODEL statement were not used to fit the propensity score model. This is grasping at straws, but if there are missing values in any of those four continuous variables, this bug (assuming you're using a version of SAS before it was fixed) could lead to different propensity score models and explain why you see the error message when you only add the variables to the ASSESS statement. Matching on the precomputed propensity score values predicted by PROC LOGISTIC would be one workaround for this issue (if it is the issue).
... View more
04-28-2020
10:36 AM
1 Like
@SteveDenham has the right idea, that error message indicates that there is no overlap in propensity score values for the two treatment conditions so the common support region does not exist.
You might try adding the four variables only to the ASSESS statement and not the PSMODEL statement. You can use the ASSESS statement to assess the balance achieved for any continuous or binary variable in the input data set, not just the variables used in the propensity score model. It might (hopefully) be the case that even if those variables are not included in the propensity score model good balance is still achieved in the matched data.
... View more
04-03-2020
11:00 AM
2 Likes
Yes the Spearman rank order correlation is another option. PROC FREQ also supports both of these measures of association. You can use the PLCORR option in the TABLES statement to request the polychoric correlation coefficient and the MEASURES option (as mentioned in @PGStats response) will request the Spearman coefficient.
You can Example 3.8 in the PROC FREQ documentation for an example using the MEASURES option.
... View more
04-03-2020
10:15 AM
I think @PGStats suggestion to consider using the measures of association supported by PROC FREQ is a good one.
I'll just add that for the case of two ordinal variables, if you can assume their values are derived from an unobserved bivariate normal distribution you could estimate the polychoric correlation by using PROC CORR.
... View more
03-26-2020
12:02 PM
2 Likes
I assume you are using the FRACTION option in the PARTITION statement. If so, you might try using ROLEVAR= option instead. This option allows you to specify a variable in input data whose values are used to assign observations to the training, test, or validation roles. Using this option would add the step of you first creating the role variable to satisfy the conditions you deem appropriate (ensuring observations from the same group are assigned to the same role, ect), but once created I think would enable you to do what you want.
Quick edit based on seeing Dave's response. I should clarify that my comment deals only with how to get a bit more control over how the partition is created, not if the analysis is properly accounting for repeated measures.
... View more