Hi all,
When I include multiple predictors in a multivariable model, SAS outputs a p-value, along with the CI. It doesn't do that if I only include one variable. How do I get SAS to print a p-value?
Thanks!
What does your code look like?
graphics on;
quantreg algorithm=simplex; model x=y / quantile= .1 .2 .25 .3 .4 .5 .6 .7 .75 .8 .9 .99; run; ods graphics off; run;
I notice that the first example in the documentation doesn't generate p values (with 2 predictors), but that values are in the output for the second example (with 13 predictors),. The difference is in the CI= option. The default for 'smaller' datasets is a rank based method that does not generate t values and p values for the regression coefficients. Try adding CI=RESAMPLING to your PROC QUANTREG line of code.
Alternatively, you could use a TEST statement.
Steve Denham
Hi Steve,
Thank you for your response. I have a very small sample size (n=70). I thought that using the ci=resampling option is unstable for small datasets. Is this incorrect?
Thanks.
Could well be. And CI=SPARSE may add a lot of time to the run, which leaves the use of the TEST statement. This one is easy enough with a single predictor:
TEST x1/wald lr qinteract;
The last option, QINTERACT, tests whether the estimated coefficients are different across the various quantiles.
Steve Denham
I'm getting these warning messages:
"WARNING: The test for equal coefficients across quantiles is
ignored because the joint covariance is not computed.
WARNING: Heterogeneous covariance estimate is degenerate.
Covariance and correlation for QUANTILE= 0.1 cannot be
computed.
WARNING: Heterogeneous covariance estimate is degenerate.
Covariance and correlation for QUANTILE= 0.9 cannot be
computed.
WARNING: Heterogeneous covariance estimate is degenerate.
Covariance and correlation for QUANTILE= 0.99 cannot
be computed.
WARNING: The Wald test is ignored because the covariance could
not be computed at QUANTILE= 0.1.
WARNING: The Wald test is ignored because the covariance could
not be computed at QUANTILE= 0.9.
WARNING: The Wald test is ignored because the covariance could
not be computed at QUANTILE= 0.99.
WARNING: The likelihood ratio test is ignored at QUANTILE= 0.99
because the estimated sparsity function is close to 0."
Should I be worried? I assume it's because there are no observations at certain percentiles. Is my understanding correct?
Thanks.
Worried--well estimating a 99% quantile with only 70 observations is going to cause trouble, and it appears that you need either more data, or fewer quantiles (at well defined points) for the heterogeneous (QINTERACT) to be able to deliver. I would look at deciles or quartiles and see how this works out.
Steve Denham
Hi Steve,
I just ended up using "ci=resampling" and I stopped getting those warning messages. The reason why I decided to use that is that when I did a multivariable model, SAS automatically used that option to calculate the confidence intervals. Do you think my reasoning is justifiable?
Yes I do. Good work on this.
Steve Denham
Thank you for walking through the problem with me!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.