turn on suggestions

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

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Specify slope

Topic Options

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

08-02-2010 06:52 PM

I would like to specify a value of '1' to my slope and estimate the intercept. Is there a way to do that in proc GLM or another proc?

Thanks

Thanks

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

08-03-2010 07:25 AM

I suppose that you currently have something like:

proc glm data=one;

model y=x;

run;

if so, then try:

data two;

set one;

diff=y-x;

run;

proc glm data=two;

model diff=;

run;

The standard error of the estimate will be slightly biased, but the point estimate should be OK.

Steve Denham

proc glm data=one;

model y=x;

run;

if so, then try:

data two;

set one;

diff=y-x;

run;

proc glm data=two;

model diff=;

run;

The standard error of the estimate will be slightly biased, but the point estimate should be OK.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-16-2010 02:57 PM

I finally got around to trying the code and it worked really well for my requirement.

Thanks to both of you for the suggestions. the code that I used was the first one that Steve suggested - proc glm modeling the difference.

Thanks for the help!

Thanks to both of you for the suggestions. the code that I used was the first one that Steve suggested - proc glm modeling the difference.

Thanks for the help!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

08-03-2010 02:42 PM

Many of the SAS procedures which allow you to fit a regression model allow specification of an "offset" parameter. The GLM procedure is one of the procedures which allow specification of an offset parameter. When you specify that a variable is an offset parameter, then that variable enters the right hand side of the model with slope coefficient fixed at 1.

With the GLM procedure, code for fitting a regression model including an offset parameter would be something like the following:

proc glm data=mydata;

class x1 x2;

model y = x1 x2 x3 / offset=z s;

run;

In the above code, there is a variable Z which is to have a slope coefficient of 1. It should be pointed out that you can only name one variable as being an offset parameter. The documentation for the GLM procedure also states that "This variable cannot be a CLASS variable, and it cannot be the response variable or one of the explanatory variables." Only a moments thought would prove that all of these conditions make sense.

With the GLM procedure, code for fitting a regression model including an offset parameter would be something like the following:

proc glm data=mydata;

class x1 x2;

model y = x1 x2 x3 / offset=z s;

run;

In the above code, there is a variable Z which is to have a slope coefficient of 1. It should be pointed out that you can only name one variable as being an offset parameter. The documentation for the GLM procedure also states that "This variable cannot be a CLASS variable, and it cannot be the response variable or one of the explanatory variables." Only a moments thought would prove that all of these conditions make sense.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

08-04-2010 07:20 AM

Dale,

Did you mean GLIMMIX, rather than GLM? I got sensible answers from GLIMMIX, but only error messages from GLM. Maybe I missed something in the syntax.

Steve Denham

Did you mean GLIMMIX, rather than GLM? I got sensible answers from GLIMMIX, but only error messages from GLM. Maybe I missed something in the syntax.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

08-04-2010 12:50 PM

Thank you all so much for you responses. I have not had a chance to try any of your suggestions yet but will do so soon and let you know. Thanks again for the help.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

08-04-2010 02:37 PM

Steve,

I think that I must have clicked on the GENMOD procedure rather than the GLM procedure in the SAS documentation. I thought it was a bit odd that there would be an OFFSET parameter in GLM. I should have double-checked. The GLIMMIX procedure also supports an OFFSET parameter specification. However, not everyone has GLIMMIX installed.

If GLIMMIX is available, the code which I showed previously would work directly with only a change of the procedure name from GLM to GLIMMIX. If GLIMMIX is not available and GENMOD is employed, then one would need to remove the option S from the model statement.

Thus, we would write either:

proc glimmix data=mydata;

class x1 x2;

model y = x1 x2 x3 / offset=z s;

run;

or

proc genmod data=mydata;

class x1 x2;

model y = x1 x2 x3 / offset=z;

run;

Dale

I think that I must have clicked on the GENMOD procedure rather than the GLM procedure in the SAS documentation. I thought it was a bit odd that there would be an OFFSET parameter in GLM. I should have double-checked. The GLIMMIX procedure also supports an OFFSET parameter specification. However, not everyone has GLIMMIX installed.

If GLIMMIX is available, the code which I showed previously would work directly with only a change of the procedure name from GLM to GLIMMIX. If GLIMMIX is not available and GENMOD is employed, then one would need to remove the option S from the model statement.

Thus, we would write either:

proc glimmix data=mydata;

class x1 x2;

model y = x1 x2 x3 / offset=z s;

run;

or

proc genmod data=mydata;

class x1 x2;

model y = x1 x2 x3 / offset=z;

run;

Dale