Geomean의 사용: Skewed data, scaled data, 

  •  Population growth
  •  Compounding interest
  •  Bioassays
  •  Radioactive decay
  •  Dose-response relationships
  •  Count data
  •  Time Series data
  •  Longitudinal data
  •  Repeated measures data
  •  Bioequivalence trials

기하평균사용시의 조건: 0이나 음의 값이 있으면 안됨..

만약 그렇다면 어떻게 할까?

1. Adjust your scale so that you add 1 to every number in the data set, and then subtract 1 from the resulting geometric mean.

2. Ignore zeros or missing data in your calculations.

3. Convert zeros to a very small number (often called “below the detection limit”) that is less than the next smallest number in the data set.

 

FINDING GEOMETRIC MEANS WITHIN AN OBSERVATION: GEOMEAN()/GEOMEANZ()

FINDING GEOMETRIC MEANS FOR A POPULATION

 

Geometric mean CV값

 

 

 

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

[SAS] Proc ANOVA/ Proc ttest -ODS output p-value  (0) 2020.07.29
[SAS] time, date 더하기, 빼기  (0) 2020.07.28
PROC REPORT (title page)  (0) 2020.07.27
RM ANOVA (proc glm, proc mixed)  (0) 2020.07.21
SAS Procedure 들  (0) 2019.03.03
블로그 이미지

고향이안드로메다

,

ods exclude all;   /** ods output 출력 제한 **/
proc anova data = pk_data2    ;   
class trt ;
model   xx1 xx2 xx3   =trt ; 
  ods output   overallANOVA=Statistics1     ;
run ;

proc anova ods

 

proc ttest data = pk_datax2 dist=lognormal  ;   
var   xx1 xx2 xx3 xx4  ; 
class trt ;
 ods output   Statistics=Statistics1  ttests= ttests  ;
run ;


data geomean ; set statistics1 ;  //** Geomean 계산 **//
length trt $3 ;
 keep Variable class GeomMean  n0 ;
 if ((class NE "R") and (class NE "T")) then delete ;
  n0+1;
  rename class = trt ;
  run ;

 

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

Geometric mean 계산  (0) 2020.07.29
[SAS] time, date 더하기, 빼기  (0) 2020.07.28
PROC REPORT (title page)  (0) 2020.07.27
RM ANOVA (proc glm, proc mixed)  (0) 2020.07.21
SAS Procedure 들  (0) 2019.03.03
블로그 이미지

고향이안드로메다

,

특정시간/날짜에서 특정시간이나 날짜를 빼고자 할 때.. 그리고 다시 합치기

 

data xxx ; set dm_data.ex;

date = datepart(EXSTDTC) ;  date1 = datepart(EXSTDTC) ;  /**날짜추출  **/
time = timepart(EXSTDTC);  time1 = timepart(EXSTDTC); /**시간추출  **/


   date2 = date + 7 ;   /**7일을 더할때  **/ 
    time2 = time + 60*60*2 ;  /**2시간을 더할때, 60sec, 60min  **/
 
 datetime = dhms(date2,0,0,time2) ; /**날짜와 시간을 같은 field로 합치기 - dhms fx사용  **/
 format date ddmmyy10. date2 ddmmyy10.  time time8. time2 time8datetime  DATETIME22.3;
run ;

 

 

output

 

 

DATETIME22.3

  30MAY2020:08:20:00.000   --> 1906446000  숫자 1의 의미  1초을 의미.

 만약 7주일 10시간 12분 5초 후 계산 (2020년 6월 6일 오후 6시 32분 5초) :

            7 * 24*60*60 + 10*60*60 + 12*60 +5 = 641525

              1906446000  +  641525   = 1907087525

 

 

 

 

기타 

data have;
  eventDate = datetime();
  
format eventDate datetime22.3;

  eventYear = year( datepart(eventDate) );
  eventYear_c = put(eventDate, 
dtyear4.);
run;

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

Geometric mean 계산  (0) 2020.07.29
[SAS] Proc ANOVA/ Proc ttest -ODS output p-value  (0) 2020.07.29
PROC REPORT (title page)  (0) 2020.07.27
RM ANOVA (proc glm, proc mixed)  (0) 2020.07.21
SAS Procedure 들  (0) 2019.03.03
블로그 이미지

고향이안드로메다

,

proc report
data = ie_t
nowindows /* window 또는 wd - 보고서를 보고서창에 표시 */ ;
spacing = 1
headline  /*열 제목과 제목들 사이에 간격에 밑줄로 분리  8/ ;
headskip  /* 열 제목 아래에 또는 healine 옵션을 사용했다면 밑줄 뒤에 빈줄로 표시 */: 
split = "|"  /* 분리기호  */ ;
style(report) = {just=c outputwidth=10 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 subject rand_id   seq   ieyn ("Inclusion Criteria" iea_1 - iea_4) ("Exclusion Criteria" iea_5 -  iea_30);
define subject /id display center width =3 "Subject ID";
define rand_id /id  display center width = 5 "Randomization|ID";
 define seq /  display center width = 5 "Sequence";

 

 

변수정의 

참고: https://www.lexjansen.com/phuse/2015/is/IS08.pdf

 

참고: http://www.misug.org/uploads/8/1/9/1/8191072/bcochran_proc_report.pdf

 

 

 

With the WIDTH option individual column widths can be specified for each variable

 

 

SPANNING HEADERS

 

HEADLINE AND HEADSKIP

The option HEADLINE draws a line under all column headings and the spaces between them, whereas the HEADSKIP option creates an empty row beneath all column headings (in conjunction with HEADLINE it creates the empty row beneath the separator line of the column headings). The example below shows the usage of these two options.

 

 

The PROC REPORT option can be decreased, if more space is needed to show content or it can be increased to improve the readability of the output, as shown below:

 

 

 

 

블로그 이미지

고향이안드로메다

,

 

DATA wide;
  INPUT sub group dv1 dv2 dv3 dv4;
CARDS;
1 1  3  4  7  3
2 1  6  8 12  9
3 1  7 13 11 11
4 1  0  3  6  6
5 2  5  6 11  7
6 2 10 12 18 15
7 2 10 15 15 14
8 2  5  7 11  9
;
RUN;
 


PROC PRINT DATA=wide ;  RUN; 

PROC GLM DATA=wide;
  CLASS group;
  MODEL dv1-dv4 = group / NOUNI ;
  REPEATED trial 4;  /* level of trial -> DV1-DV4 => 1-4 trial * group
RUN; 
quit;

 

 

DATA long ; SET Wide;

dv = dv1; trial = 1; OUTPUT;

dv = dv2; trial = 2; OUTPUT;

dv = dv3; trial = 3; OUTPUT;

dv = dv4; trial = 4; OUTPUT;

DROP dv1 - dv4 ;

RUN;

 

PROC PRINT DATA=long ; RUN;

 

 

PROC MIXED DATA=long;

CLASS sub group trial;

MODEL dv = group trial group*trial;

REPEATED trial / SUBJECT=sub TYPE=CS;

run;

 

 

 

 

 

참조

https://webpages.uidaho.edu/CALS-StatProg/sas/workshops/mixed/ANOVA.pdf

http://hosting03.snu.ac.kr/~hokim/seminar/repeat.pdf

https://support.sas.com/resources/papers/proceedings/pdfs/sgf2008/374-2008.pdf (random or fixed)

Proc Mixed - Right Options to get Right Output (사용법설명)

https://www.lexjansen.com/nesug/nesug11/sa/sa03.pdf

 

https://www.pharmasug.org/proceedings/2016/PO/PharmaSUG-2016-PO06.pdf

 

PROC MIXED DATA = Indat ;

  CLASS Usubjid Sequence Period Trt ;

  MODEL LCMAX = Sequence Period Trt / SOLUTION DDFM = KR ;

REPEATED TRT / SUBJECT = Usubjid TYPE = UN ;

  ESTIMATE "B VS A" Trt -1 1 0 / CL ALPHA = 0.10 ;

  ESTIMATE "C VS A" Trt -1 0 1 / CL ALPHA = 0.10 ;

  ESTIMATE "C VS B" Trt 0 -1 1 / CL ALPHA = 0.10 ;

  LSMEANS Trt/ CL ALPHA = 0.10 ;

ODS OUTPUT TESTS3 = Tests3 ESTIMATES = Estimates LSMEANS = Lsmeans ;

RUN ;

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

주의점

 

 

PROC MIXED allows missing values. In contrast, PROC GLM with REPEATED statement does not allow missing values, that is, if there is a missing value in one subject, all observations in this subject will be ignored.

 

Mixed model incorporates a random term whereas PROC ANOVA uses only fixed effects.

 

PROC MIXED uses Maximum Likelihood Estimation, while PROC ANOVA uses Least Squares. 

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

[SAS] time, date 더하기, 빼기  (0) 2020.07.28
PROC REPORT (title page)  (0) 2020.07.27
SAS Procedure 들  (0) 2019.03.03
Call R Graphics from PROC IML (R graph 부르기)  (0) 2019.02.14
TTEST using proc mixed  (0) 2018.11.30
블로그 이미지

고향이안드로메다

,

https://www.sas.com/content/dam/SAS/ko_kr/doc/productbrief/SAS_Procedure_summary_V1.2.pdf



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

PROC REPORT (title page)  (0) 2020.07.27
RM ANOVA (proc glm, proc mixed)  (0) 2020.07.21
Call R Graphics from PROC IML (R graph 부르기)  (0) 2019.02.14
TTEST using proc mixed  (0) 2018.11.30
MACRO 사용하기  (0) 2018.11.28
블로그 이미지

고향이안드로메다

,

참고

Accessing_R_Within_the_SAS_System_-_Alan_Mitchell.pdf

PharmaSUG-2016-QT14.pdf



SAS에서 R 돌리기전 configuration

참고1


검토

proc options option=RLANG;
run;
NORLANG  Do not support access to R language interfaces

If the SAS log contains this statement, you do not have permission to call R from the SAS system.

RLANG  Support access to R language interfaces

If the SAS log contains this statement, you can call R from the SAS system.

submit / R;
   hist(p, freq=FALSE) # histogram
   lines(est)          # kde overlay
endsubmit;


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

RM ANOVA (proc glm, proc mixed)  (0) 2020.07.21
SAS Procedure 들  (0) 2019.03.03
TTEST using proc mixed  (0) 2018.11.30
MACRO 사용하기  (0) 2018.11.28
proc FORMAT  (0) 2018.11.28
블로그 이미지

고향이안드로메다

,
Paired t-test
data pressure;
         input SBPbefore SBPafter @@;
         datalines;
   120 128   124 131   130 131   118 127
   140 132   128 125   140 141   135 137
   126 118   130 132   126 129   127 135
   ;
   run;


ods graphics on; proc ttest; paired SBPbefore*SBPafter; run;

ods graphics off;


Paired t-test using PROC MIXED procedure

ref-1

proc mixed method=type3; 

 class pt paired; 

 model y = paired / ddfm=kenwardroger; 

 random pt; 

 lsmean paired / tdiff cl; 

run; 



data conc2a conc2b; set conc2 ;

if (order1 = 2 or order1 =3) ;

if trt = "R" then output conc2a;

if trt = "T" then output conc2b ;


run ;


%macro ttest(aaa);

 proc mixed data = conc2&aaa method=type3;

 class subject  order1 ;

 model conc  = order1 / ddfm=kenwardroger; 

random subject  ;

 lsmean order1/ tdiff cl; 

run; 


%mend ;

%ttest(a);

%ttest(b);

 

Unpaired t-test

proc ttest data = mainlib.file1; var _numeric_; class buy_ind; run;

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

SAS Procedure 들  (0) 2019.03.03
Call R Graphics from PROC IML (R graph 부르기)  (0) 2019.02.14
MACRO 사용하기  (0) 2018.11.28
proc FORMAT  (0) 2018.11.28
ODS 특수문자 입력 (ODS escapechar)  (0) 2018.11.26
블로그 이미지

고향이안드로메다

,