Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to compute regression coefficients with proc mixed in sas?

Here are my data. Data are structured like so: id x1 x2 x3 y.

I used proc mixed to analyze it, but now want to determine regression coefficients and I don't know how to do it. I'm only a beginner with sas. From the results I see that x1, x2, x3 and x1x2x3 are the significant effects, but how to determine the coefficients alpha, beta, gamma, delta, theta:

y = theta + alpha*x1 + beta*x2 + gamma*x3 + delta*x1*x2*x3

This is my code:

ods graphics on;
proc mixed data=test;
  class x1 x2 x3;
  model y = x1 | x2 | x3 / solution residual;
  random id;
run;
ods graphics off;

EDIT 1: Here is a part of the table Solutions for Fixed Effects:

Solutions for Fixed Effects

Since x1 has two levels, there are two rows for it in the table. Do I get the effect of x1 by summing these two values: -109.07 for the first row and 0 for the second, or should I do something else? Note that this is 2^k design. The effect of x1 should be computed as half the difference between the average values for y when x1 is high (20) and when it is low (10).

like image 968
Radojko Avatar asked Nov 08 '22 17:11

Radojko


1 Answers

Based on your model, x1, x2, x3 should be treated as continuous variables, then you should be able to get the coefficients in your model.

proc mixed data=test;
model y=x1 x2 x3 x1*x2*x3/ solution residual;
random id/s;
run;

However, based on your code and the values of x1, x2 and x3, it would be better to treat them as categorical variable as what you did, then the Estimate in your table actually is the mean difference between whatever two levels. The link below may help you understand your results. http://support.sas.com/kb/38/384.htmlexplanation of estimation of coefficients

like image 181
Rosie Rosie Avatar answered Dec 22 '22 02:12

Rosie Rosie