p_vlaue를 소수점 맞추어넣거나, 만약 <0.001일때 그대로 표시하려면..


format =pvalue6.4



proc report

data = gg6

nowindows

spacing = 1

headline

headskip

split = "|"

style(report) = {just=c outputwidth=9 in font_face='맑은 고딕' vjust=middle}

style(header) = {font_face='맑은 고딕' vjust=middle }

style(column) = {font_face='맑은 고딕' vjust=middle}

style(summary)= {font_face='맑은 고딕' vjust=middle}

style         = {frame=hsides rules=rows};

columns  no_  _label_   TRT,( meansd  CV_ ) probf      ;

define no_ /  group noprint ;

define _label_ /  group  order=data   width = 8 "Parameter" ;

define TRT /across  center width = 8 "Treatment" ;

define meansd / display center  width = 8 " "  ;

define CV_ / display center f=4.1  width = 8 "CV (%) "  ;

define probf /   center  format =pvalue6.4  width = 4  "P-value ";

 

compute after ;

line left @2 "P-value is calculated using paired t-test." ;

line lfeft @2 "Values are presented as mean±SD, except T^{sub max,ss} which is presented as median (minimum, maximum)" ;

endcomp;


 run;


블로그 이미지

고향이안드로메다

,

X= ROUND(12.65);

---> X=13이 된다. 즉, 반올림.

 

X= ROUND(12.65, .1);

---> X=12.7이 된다. 즉, 소수점 첫째자리까지 반올림.

 X= ROUND(12.6526, .001);

---> X=12.653이 된다. 즉, 소수점 세째자리까지 반올림.


X= INT(4.32);

---> X=4가 된다. 즉, 버림.



블로그 이미지

고향이안드로메다

,
data result; 
    actual_dt = "23MAY16:07:21:00"dt; 
    visit_date = datepart(actual_dt); 
    visit_time = timepart(actual_dt); 

    format visit_date ddmmyy10. visit_time time8.; ***numeric format *** ;
run; 

문자형태로 바꿀려면..  vstm =  put(timepart(VSDTC1),time8.) ;


숫자(날짜) 와 숫자(시간)합치기(concatenating two separate fields (date and time) into one datetime )

                       : newdtm=dhms(date, 0,0,time);

문자를 숫자시간으로 

   

data ae2 ;    set ae1 ;

 **start date ** ;

 AESTDTC_RAW1 = input(AESTDTC_RAW, yymmdd10.) ;

 format AESTDTC_RAW1 date10. ;

 AESTTM1 = input(AESTTM,  time8.) ;

sttm = dhms(AESTDTC_RAW1, 0,0, AESTTM1) ;


** End date ** ;

AEENDTC_RAW1 = input(AEENDTC_RAW, yymmdd10.) ;

 format AEENDTC_RAW1 date10. ;

 AEENTM1 = input(AEENTM,  time8.) ;

edtm = dhms(AEENDTC_RAW1, 0,0, AEENTM1) ;


duration = (edtm - sttm)/24/60/2.5 ; /* */

RUN;


ata want; 
  attrib newdate format=datetime25.;
  date="01jan2016"d;
  time=input("9:10:07",time8.);
  newdate=input(catx("T",put(date,date9.),put(time,time8.)),datetime.);
  if datepart(newdate)=date then chk1=1;
  if timepart(newdate)=time then chk2=1;
run;
AS StatementResults
 
----+----1----+
put day mmddyy2.;
10
put day mmddyy3.; 
 10
put day mmddyy4.; 
1025
put day mmddyy5.;
10/25
put day mmddyy6.; 
102505
put day mmddyy7.;
 102505
put day mmddyy8.; 
10/25/05
put day mmddyy10.; 
10/25/2005



참고



/*

data ae4 ;

set ae3  ;

duration = put(duration, 7.1);

date_start = datepart(AESTDAT) ;

format date_start date9.; 

informat date_start date9.; 


rand_code = input(substr(rand_id,2,3),10.) ;

period_a1s = input('07APR2018',date9.) ; ****1기 2기 시작 및 종료 날짜 ***;

period_a1e =  input('20APR2018',date9.) ;

period_a2s = input('21APR2018',date9.) ;

period_a2e =  input('01MAY2018',date9.) ;

period_b1s = input('14APR2018',date9.) ;

period_b1e =  input('27APR2018',date9.) ;

period_b2s = input('28APR2018',date9.) ;

period_b2e =  input('09MAY2018',date9.) ;


if ((rand_code <27) and ((period_a1s=<date_start) and (period_a1e=>date_start))) then do ; period = 1; end ;

if ((rand_code <27) and ((period_a2s=<date_start) and (period_a2e=>date_start))) then do ; period = 2; end ;

if ((rand_code >26) and ((period_b1s=<date_start) and (period_b1e=>date_start))) then do ; period = 1; end ;

if ((rand_code >26) and ((period_b2s=<date_start) and (period_b2e=>date_start))) then do ; period = 2; end ;


if ((seq = 1) and (period = 1)) then do ; trt = "R" ; end ;

if ((seq = 1) and (period = 2)) then do ; trt = "T" ;end ;

if ((seq = 2) and (period = 1)) then do ; trt = "T" ; end ;

if ((seq = 2) and (period = 2)) then do ; trt = "R" ;end ;

run;

 */

'통계 clinical trial > SAS' 카테고리의 다른 글

엑셀 파일 만들기 (ODS EXCEL)  (0) 2018.11.02
SAS에서 excel 파일 불러오기 (PROC IMPORT)  (0) 2018.11.02
P-value 집어넣기  (0) 2018.11.01
반올림 버림  (0) 2018.11.01
숫자->문자, 문자->숫자  (0) 2018.11.01
블로그 이미지

고향이안드로메다

,

문자->숫자

1) xxx = input(zzz, 10.);

2) xxx = zzz *1


숫자 -> 문자

숫자변수를 문자변수로 바꾸는 코딩은 put함수를 사용합니다기본적인 포멧은 put(var, 자리수)


yyy = put (numeric, 15.);



data test;
length x $ 6;
input x;
y61=input(x,6.1);
best61=input(x,best6.1);
y60=input(x,6.0);
best60=input(x,best6.0);
cards;
.001
0.01
10
100
10.0
1E3
1.52E3
;

This produces the following data:

OBS     X          Y61    BEST61      Y60   BEST60
 1    .001       0.001     0.001     0.00     0.00
 2    0.01       0.010     0.010     0.01     0.01
 3    10         1.000     1.000    10.00    10.00
 4    100       10.000    10.000   100.00   100.00
 5    10.0      10.000    10.000    10.00    10.00
 6    1E3      100.000   100.000  1000.00  1000.00
 7    1.52E3  1520.000  1520.000  1520.00  1520.00


'통계 clinical trial > SAS' 카테고리의 다른 글

엑셀 파일 만들기 (ODS EXCEL)  (0) 2018.11.02
SAS에서 excel 파일 불러오기 (PROC IMPORT)  (0) 2018.11.02
P-value 집어넣기  (0) 2018.11.01
반올림 버림  (0) 2018.11.01
datetime 변수에서 날짜와 시간을 분리  (0) 2018.11.01
블로그 이미지

고향이안드로메다

,

텍스트 줄을 바꾸려는 셀을 마우스 오른쪽 단추로 클릭하고 셀 서식을 클릭합니다. 맞춤 탭에서 텍스트 줄 바꿈 확인란을 선택하고 확인을 클릭합니다.


먼저 줄을 바꾸려는 셀을 두 번 클릭합니다. 


그런 다음, 줄 바꿈을 넣으려는 지점을 클릭하고 Alt + Enter를 누릅니다.

블로그 이미지

고향이안드로메다

,

=substitute(A1,".com","") :::A1 쉘에서 .com을 삭제하라는 명령어 입니다



블로그 이미지

고향이안드로메다

,