PROGRAM
--------------------------------------
*************************************
CREATING NEW VARIABLES: #1
-> CASE WHEN END...
-------------------------------------
CASE-WHEN...
-> =,<,>,NOT,NE,AND,OR,IN...
-> BETWEEN AND
-> CONTAINS, ?
-> IS NULL, IS MISSING
-> =*
*************************************;
PROC SQL ;
CREATE TABLE EFFICACY1
AS SELECT *,
CASE
WHEN .< RES<0 THEN 'NEG '
WHEN 0<=RES<5 THEN 'LOW '/*CANNOT USE
'0=<RES<5'*/
WHEN 5< RES THEN 'HIGH'
ELSE 'MISS'
END AS RES_CAT
FROM EFFICACY ;
QUIT ;
PROC PRINT; RUN ;
*************************************
CREATING NEW VARIABLES: #2
-> CASE WHEN END...+ ALPHA
-> CHANGE THE DEFINITION BY
VISIT (BASELINE OR POST-BASELINE)
*************************************;
PROC SQL ;
CREATE TABLE D3
AS SELECT *,
CASE
WHEN VISIT1 IN (1) & .<RES<0 THEN 'NEG '
WHEN VISIT1 IN (1) & 0<RES<=10 THEN 'LOW '
WHEN VISIT1 IN (1) & 10<RES
THEN 'HIGH'
WHEN VISIT1 IN (2) & .<RES<0 THEN 'NEG '
WHEN VISIT1 IN (2) & 0<RES<=5 THEN 'LOW '
WHEN VISIT1 IN (2) & 5<RES THEN 'HIGH'
ELSE 'MISSING'
END AS RES_CAT
FROM EFFICACY ;
QUIT ;
--------------------------------------
PROC PRINT; RUN ;
Post a Comment
別ページに移動します