Andreas Jensen
Andreas Jensen

Reputation: 21

How do I force the regression line to go through (0,1)?

Edited question: now the restriction of the intercept needs to be materialized through a REG statement within a PROC SGPANEL.

The syntax is:

PROC SGPANEL DATA=...;
 PANELBY ...;
 REG Y=... X=... / ...;
RUN;

I don't think that the RESTRICT statement works here. So what can I do in this situation?

...

Previous question (answered in a satisfactory manner):

I would like to force my regression line - using PROC SGPANEL - to go through (0,1) (not (0,0), then I would use the NOINT option in the MODEL statement). How can I do this?

I've created a dummy variable in place of my response variable y:

dummy_y=y-1

Now my idea is to use the NOINT option and somehow replace the values on the vertical axis which are (-1, 0, 1, 2) with the values (0, 1, 2, 3).

Now my questions are:

1) How can I manipulate the values on the vertical axis according the intention described above?

2) How can I otherwise force the intercept to be one?

My syntax is as follows:

proc reg date=DS;

model dummy_y=x / noint;

run;

Appreciate any help.

Upvotes: 0

Views: 1075

Answers (1)

Christian Colot
Christian Colot

Reputation: 22

I think you should try your second option: using an intercept but with the constraint that it should be 1 with the restrict statement:

proc reg date=DS;

model y=x ;
restrict intercept=1;

run;

Upvotes: 1

Related Questions