Regression
Hello everyone,
I am trying to fit categorical data to a continuous variable. The attached figure is a group of linear regression lines I created by putting both variables as continuous and grouped by another variable 'time'. My data is unbalanced, variable 'time' has unequal observations.
I need help in obtaining regression equation (polynomial or quadratic?) (y var to x var) for each 'time' variable but fitted with the best distribution.
/*this is the code I used to fit my data and produce those figures*/
proc glimmix data=reg;
by time;
class block plot;
model Y=X / htype=3 solution cl;* dist=binomial link=logit;
random block;
random _residual_/ subject=plot type=cs;
run;
/*but I think 'by time' statement is not accurate,
so I tried doing this way, but do not know
how to extract regression equation for each 'time' from solution*/
proc glimmix data=reg;
class block plot time;
model Y=X|time / htype=3 solution cl;* dist=binomial link=logit;
random block;
random _residual_/ subject=plot type=cs;
run;
/* when trying with multinomial distribution and using method=quad,
because my data is unbalanced, I am getting this error
"Estimation by quadrature is available only if the data can be processed by subjects.
Make sure that all G-side RANDOM statements have SUBJECT= effects.
If there are multiple SUBJECT= effects they need to form a containment
hierarchy, e.g., SUBJECT=A, SUBJECT=A*B, SUBJECT=A(B), ... ."*/
I would appreciate any help.
Thanks,
Babu