Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Programming
- /
- SAS Procedures
- /
- Setting/fixing/specifying Y-intercept in Proc GLM

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 10-26-2012 07:19 AM
(2391 views)

Hi all

I was wondering how/if it was possible to specify the Y-intercept in Proc GLM?

I have been looking everywhere for a solution.

I need to set the intercept at 100.

I have a very simple model:

PROC GLM data; Class line; Model BW1= Log_CFU_Total*LINE / solution; run;

Any ideas/tips would be very much appreciated as I am totally stuck!

Thanks!

i

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

If you run the GLM model I suggested, get the slopes out and plug them into an equation that looks like %BW = 100 - log_cfu_total * slope estimate for LINE (based on the NOINT model) what do you get? All of these lines should converge on 100. They might not look like the best fit to the data, so plotting the residuals of the constructed equation would be very informative.

Since there is a log transform of the independent variable made me think of PROC NLIN as a valid alternative. Again you would need to code the LINE variable (0,1 type coding), but then a model statement that looked like:

model BW1=100 - (beta_1*Log_CFU_Total*LINE_1 + beta_2*Log_CFU_Total*LINE_2 + ... + beta_N*Log_CFU*LINE_N);

should give you what you need (I hope). You could get this back on the original (non-log transformed scale) if you wanted, but I would really worry about heterogeneous variances then. In any case, NLIN doesn't require a non-linear function, and it is a good place to fit "unusual" looking equations.

Steve Denham

7 REPLIES 7

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

What would happen if you subtract 100 from every value of BW_slaughter to get the variable BW_slaughter_minus_100 and fit:

PROC GLM data; Class line; Model BW_slaughter_minus_100 = Log_CFU_Total*LINE / solution **noint**; run;

This is untested, but it's about the only way I see to stay in PROC GLM.

If you can code up LINE as a set of dummy variables, then PROC REG has a RESTRICT statement, where you can set intercept=100. I get comparable results from both methods, but you should check to see which best fits your needs.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hi Steve

Thanks for your prompt response!

I have tried both methods, which sadly do not work with my data.

To explain, my BW variable is %Body weight. So, this must start at 100%, and decrease as CFU increases.

Despite trying these methods, the lines still do not cross the Y-axis at the same point.

Is there anything else you could recommend?

Thanks again!

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

If you run the GLM model I suggested, get the slopes out and plug them into an equation that looks like %BW = 100 - log_cfu_total * slope estimate for LINE (based on the NOINT model) what do you get? All of these lines should converge on 100. They might not look like the best fit to the data, so plotting the residuals of the constructed equation would be very informative.

Since there is a log transform of the independent variable made me think of PROC NLIN as a valid alternative. Again you would need to code the LINE variable (0,1 type coding), but then a model statement that looked like:

model BW1=100 - (beta_1*Log_CFU_Total*LINE_1 + beta_2*Log_CFU_Total*LINE_2 + ... + beta_N*Log_CFU*LINE_N);

should give you what you need (I hope). You could get this back on the original (non-log transformed scale) if you wanted, but I would really worry about heterogeneous variances then. In any case, NLIN doesn't require a non-linear function, and it is a good place to fit "unusual" looking equations.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Got it!! After a little bit of axes altering!

Thank you very much for your advice!

Graham

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

I am running with the PROC GLM model, I need to force the global intercept (constant value) (only vary the independent variables) into the model with the by variables. Does anyone know the SAS code to perform this operation?

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

If you have a known fixed value for the intercept, you can subtract that number from every Y value, and then fit a model with the NOINT option.

Steve Denhm

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Also, appending a question to a thread that has been marked "Answered" will often result in people by-passing your question.

Steve Denham

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

**If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. **

What is Bayesian Analysis?

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.