Help using Base SAS procedures

GLM + restrictions on coefficients

Accepted Solution Solved
Reply
Contributor
Posts: 33
Accepted Solution

GLM + restrictions on coefficients

Hi,

I am having a hard time to run proc glm. Here is what I want to do:

proc glm data=a;

     model y=x1 x2 x3 x4;

run;

where I need to restrict x1=x2.

How can I do it in proc glm?

Thanks in advance.

Thanks,

Sunny


Accepted Solutions
Solution
‎03-20-2015 03:15 PM
Trusted Advisor
Posts: 2,113

Re: GLM + restrictions on coefficients

proc glm data=a (WHERE=(x1=x2));

     model y=x1 x3 x4;

run;

This will run the GLM on just those cases where x1=x2.  I removed x2 from the model because it makes the design matrix singular.

View solution in original post


All Replies
Solution
‎03-20-2015 03:15 PM
Trusted Advisor
Posts: 2,113

Re: GLM + restrictions on coefficients

proc glm data=a (WHERE=(x1=x2));

     model y=x1 x3 x4;

run;

This will run the GLM on just those cases where x1=x2.  I removed x2 from the model because it makes the design matrix singular.

Contributor
Posts: 33

Re: GLM + restrictions on coefficients

Many thanks!

☑ This topic is solved.

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

Discussion stats
  • 2 replies
  • 171 views
  • 0 likes
  • 2 in conversation