jeudi 19 mars 2015

add condition in my linear regression model in SAS

I am a beginner of SAS. I am currently doing a linear model but I stuck at fitting the model. Initially, I need to split the data into two parts first.


Here is my code to cut the data into 2 parts, T is explanatory data then C is the response.


data mydata;


set rawdata;


if T < 10 then Cbelow = C;


else Cabove= C;


run;


Then I am doing the model as I wanna to check the linear regression when T <10 and T>= 10. Then I used the data I splitted just now. Then my code is below:


proc reg data= mydata;


if T<10 then model Cbelow=T;


else model Cabove=T


run;


I got errors when I run the above code. I couldn't figure out why. Can anyone help me with issue ? Any help would be very apperaciated. Many Thanks in advance !


Aucun commentaire:

Enregistrer un commentaire