Programming the statistical procedures from SAS

Creating equation

Reply
Contributor
Posts: 23

Creating equation

[ Edited ]

Hi ,

 

Can some one help me how to get the functions for f(MTPL),f(MOD W/O Glass) , f( MOD W Glass) and f(Motor BI) in terms of AD,PI and TP components for the below conditions.

 

AD PI TP   MTPL MOD W/O Glass MOD W Glass Motor BI
0 0 0   1 0 0 0
0 0 1   1 0 0 0
0 1 0   0 0 0 1
0 1 1   1 0 0 1
1 0 0   0 1 1 0
1 0 1   1 1 1 0
1 1 0   0 1 1 1
1 1 1   1 1 1 1

 

 

Your help is much appreciated and if not atleast route me where can i get some help to get me problem resolved.

 

Regards,

Reddi.

 

Super User
Posts: 7,111

Re: Creating equation

data have;
input ad pi tp;
cards;
0 	0 	0
0 	0 	1
0 	1 	0
0 	1 	1
1 	0 	0
1 	0 	1
1 	1 	0
1 	1 	1
;
run;

data want;
set have;
mtpl = (ad = 0) * (pi = 0) or tp;
mod_wo_glass = ad;
mod_w_glass = ad;
motor_bi = pi;
run;

proc print data=want noobs;
run;

Result:

                          mod_wo_    mod_w_
ad    pi    tp    mtpl     glass      glass    motor_bi

 0     0     0      1        0          0          0   
 0     0     1      1        0          0          0   
 0     1     0      0        0          0          1   
 0     1     1      1        0          0          1   
 1     0     0      0        1          1          0   
 1     0     1      1        1          1          0   
 1     1     0      0        1          1          1   
 1     1     1      1        1          1          1   
---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Ask a Question
Discussion stats
  • 1 reply
  • 104 views
  • 0 likes
  • 2 in conversation