Fluorite | Level 6

Linear regression comparison between groups

Hi everyone I'm new to SAS so my question may be quite basic:

I have a blood test result (y) that follows the following relationship with a drug concentration (x):

Y = B0 + B1*X**0.5

As I understand this is a linear relationship for the parameters (https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_nlin_sect00...) so the regression should be done using a linear regression model.

I have used proc reg but with linear Y functions.

As I understand the code for the linear regression is:

```  proc reg data=dataser;
var X**0.5;
model Y=X;
run;```

Is that correct?

If I have the data of two groups (patients vs control) how can I compare the regression coefficients for both groups?

1 ACCEPTED SOLUTION

Accepted Solutions
Diamond | Level 26

Re: Linear regression comparison between groups

@lbelluscio wrote:

If I have the data of two groups (patients vs control) how can I compare the regression coefficients for both groups?

``````proc glm data=dataser;
class group;
model Y=group x x*group;
quit;``````

If the variable group is not statistically significant when you perform this regression, then the intercepts of the two groups are not significantly different. If the interaction x*group is not statistically significant when you perform this regression, then the slopes of the two groups are not significantly different.

--
Paige Miller
4 REPLIES 4
Super User

Re: Linear regression comparison between groups

Add one more data step to get

```data dataser; set dataser; X=sqrt(X);run;proc reg data=dataser;
model Y=X;
quit;```

Diamond | Level 26

Re: Linear regression comparison between groups

@lbelluscio wrote:

If I have the data of two groups (patients vs control) how can I compare the regression coefficients for both groups?

``````proc glm data=dataser;
class group;
model Y=group x x*group;
quit;``````

If the variable group is not statistically significant when you perform this regression, then the intercepts of the two groups are not significantly different. If the interaction x*group is not statistically significant when you perform this regression, then the slopes of the two groups are not significantly different.

--
Paige Miller
Fluorite | Level 6