Help using Base SAS procedures

How do I get SAS to output p-values for univariable quantile regression?

Reply
Occasional Contributor
Posts: 13

How do I get SAS to output p-values for univariable quantile regression?


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!

Super User
Posts: 19,770

Re: How do I get SAS to output p-values for univariable quantile regression?

What does your code look like?

Occasional Contributor
Posts: 13

Re: How do I get SAS to output p-values for univariable quantile regression?

graphics on;

quantreg algorithm=simplex; model x=y / quantile= .1 .2 .25 .3 .4 .5 .6 .7 .75 .8 .9 .99; run; ods graphics offrun;

Respected Advisor
Posts: 2,655

Re: How do I get SAS to output p-values for univariable quantile regression?

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

Occasional Contributor
Posts: 13

Re: How do I get SAS to output p-values for univariable quantile regression?

Posted in reply to SteveDenham


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.

Respected Advisor
Posts: 2,655

Re: How do I get SAS to output p-values for univariable quantile regression?

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

Occasional Contributor
Posts: 13

Re: How do I get SAS to output p-values for univariable quantile regression?

Posted in reply to SteveDenham


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.

Respected Advisor
Posts: 2,655

Re: How do I get SAS to output p-values for univariable quantile regression?

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

Occasional Contributor
Posts: 13

Re: How do I get SAS to output p-values for univariable quantile regression?

Posted in reply to SteveDenham

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?

Respected Advisor
Posts: 2,655

Re: How do I get SAS to output p-values for univariable quantile regression?

Yes I do.  Good work on this.

Steve Denham

Occasional Contributor
Posts: 13

Re: How do I get SAS to output p-values for univariable quantile regression?

Posted in reply to SteveDenham

Thank you for walking through the problem with me! Smiley Happy

Ask a Question
Discussion stats
  • 10 replies
  • 585 views
  • 3 likes
  • 3 in conversation