Programming the statistical procedures from SAS

How to do an Inverse regression in SAS?

Accepted Solution Solved
Reply
Contributor
Posts: 45
Accepted Solution

How to do an Inverse regression in SAS?

Would someone help me on How to do an Inverse regression in SAS?

I actually need to generate Confidence interval of the response variable to a quadratic polynomial model,

Thanks,

Marcio


Accepted Solutions
Solution
‎10-17-2014 11:00 AM
Respected Advisor
Posts: 4,754

Re: How to do an Inverse regression in SAS?

A simpler approach would be to reparameterize your quadratic equation so that the position of the maximum is one of the parameters. That way you would get your confidence interval as a result of the regression.

So, for example, replace your equation Y = a + b*X + c*X**2 by Y = a - 2*c*Xm*X + c*X**2 where Xm is the position of the maximum that will be estimated by the regression procedure.

PG

PG

View solution in original post


All Replies
Respected Advisor
Posts: 2,655

Re: How to do an Inverse regression in SAS?

Hi Marcio,

Haven't done an inverse regression in years, but here goes on what I would do:

1. Regress y on x and x*x

2. Get confidence bounds on predicted value of interest.

3. Plug in upper bound as Y, and solve for x (IML would be a big help here).

4. Repeat for lower bound, thus giving inverted confidence bounds.

Maybe somebody has a macro, or knows the right PROC, to do this.

Steve Denham

Contributor
Posts: 45

Re: How to do an Inverse regression in SAS?

Hi Steve, I appreciate your prompt response.

Could you elaborate on Step 3?

I only used IML for creating contrast coefficients for unequal spaced levels of treatments.

Thank you,

Marcio

SAS Super FREQ
Posts: 3,547

Re: How to do an Inverse regression in SAS?

For a general regression model, you need to find the value of x that is mapped to a particular Y. For the general case you need to solve an inverse problem by using the FROOT function or the bisection method.  For a quadratic polynomial model I don't see the need for IML: just use the quadratic formula.

Contributor
Posts: 45

Re: How to do an Inverse regression in SAS?

Rick,

Thanks for your response.

Could you expand on the "just use the quadratic formula", Do I use that on the FROOT function?

Thanks,

Marcio

Trusted Advisor
Posts: 1,671

Re: How to do an Inverse regression in SAS?

Contributor
Posts: 45

Re: How to do an Inverse regression in SAS?

Paige, Thanks!

I know the formula for a quadratic equation.

My question is : How do I generate a Confidence interval of the response variable to a quadratic polynomial model?

SAS Super FREQ
Posts: 3,547

Re: How to do an Inverse regression in SAS?

Upon re-reading your question, I see that you want confidence intervals, not just the x value that corresponds to the specified Y value. Although the mean model is quadratic, the unpper and lower prediction limits are not quadratic, so I retract my statement about using the quadratic equation.

Let's use an example to see if I understand what I think you want to do. Please correct me if I am wrong. Suppose that you want to model WEIGHT in the sashelp.class data set by a quadratic function of HEIGHT.  You could run the following regression:

ods graphics on;

proc glm data=sashelp.class;

model weight = height height*height;

run;

My understanding is that you have a particular response value such as Weight=100. You want to find the top of the prediction limits and the bottom of the prediciton limits and use those values to find x_min and x_max. In the following image, x_min=55.5 and x_max=69.   Is that correct?  Or do you want to use the mean prediction (the light blue band) to find x_min and x_max, which will result in a narrower interval?

FitPlot.png

Contributor
Posts: 45

Re: How to do an Inverse regression in SAS?

Rick,

I appreciate your answer. I think we are getting to understand each other. See, in the image below, I am predicting the animal's requirement for a given nutrient. There requirement is at the level in which the nutrient maximizes growth. So say it the level of the nutrient is 0.20% (x axis). I would like to know the CI for that value, say 0.17-0.22%. Does that makes sense?

Thanks,

Marcio

chart.jpg

SAS Super FREQ
Posts: 3,547

Re: How to do an Inverse regression in SAS?

Oh. That is different. One of the statisticians ought to be able to describe how to do this.  I think it uses the standard error of the estimate for the quadratic coefficient.

Solution
‎10-17-2014 11:00 AM
Respected Advisor
Posts: 4,754

Re: How to do an Inverse regression in SAS?

A simpler approach would be to reparameterize your quadratic equation so that the position of the maximum is one of the parameters. That way you would get your confidence interval as a result of the regression.

So, for example, replace your equation Y = a + b*X + c*X**2 by Y = a - 2*c*Xm*X + c*X**2 where Xm is the position of the maximum that will be estimated by the regression procedure.

PG

PG
Contributor
Posts: 45

Re: How to do an Inverse regression in SAS?

PGStat,

Thanks ! It worked great. Now, do you know where I can find a reference for this information that you provided?

Thanks,

Marcio

Respected Advisor
Posts: 4,754

Re: How to do an Inverse regression in SAS?

Basic calculus. Very old stuff. Smiley Happy

PG

PG
Contributor
Posts: 45

Re: How to do an Inverse regression in SAS?

hahaha Now I saw what you did. Just replace b1 by the maximum value of X.

Thanks a lot! Saving lives!

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 13 replies
  • 960 views
  • 6 likes
  • 5 in conversation