亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

SAS Baseline 的寫法

SAS Day 21: Baseline Value

Background:

How do we decide if the Weight Loss program/drug is effective or the laser operation improves the vision? Usually, we compare the weights before and after a program or track the vision before and after the eye laser surgery. The Change From Baseline is a critical measurement of efficacy analysis. Therefore, it is very crucial to record the correct baseline records.

Baseline Definition:
The last non-missing record before or on the day of treatment.

Problem: Generate the baseline information with a dummy ADEFF  dataset.

[caption id=“attachment_1403” align=“alignnone” width=“1280”]image

suju / Pixabay[/caption]

**Solutions: **

  • Create Baseline records with SAS function Merge **
    1. Output Base records
    * 2. Select the Baseline values

    * 3. Merge with the Original datasets

    * 4. Clean the datasets*
data base pbase;
set eff1;
if avisitn<=1 then output base;
else output pbase;
run;

proc sort data=base ;
by usubjid paramcd avisitn;
run;

**Baseline values: last non-missing value before or on the first treatment.;
data base1(keep=usubjid aval paramcd base avisitn rename=(avisitn=avisitn1));
set base(where=(aval ne . ));
by usubjid paramcd avisitn;
if last.paramcd;
rename aval=base;
run;

**merge with original dataset;
data all;
merge eff1(in=a) base1(in=b);
by usubjid paramcd;
*if a and avisitn<avisitn1 then base=.;
if a;
run;

data all;
set all;
if avisitn< avisitn1 then base=.;
run;

Output Dataset:

image

  • Create Baseline records with SAS step **Retain **
    Note: Retain is an easier method with the Definite Avisitn number, or it can get messy.
data base2;
set eff1;
by usubjid paramcd avisitn;
retain base;
if first.paramcd then do;
base=.; end;
if avisitn=1 then do ; base=aval; end;
run;

Output dataset:

image

Summary:

In the clinical industry, the dataset could be more complicated, I prefer to use the Merge method if the dataset structure is complex. If the data is clean and straightforward with a definitive avisitn for baseline, Retain is a better choice.

Note: there are might be various conditions and restrictions for the baseline, such as a test on the same date but different timepoint.

Happy studying!! 🤟

點擊查看更多內容
TA 點贊

若覺得本文不錯,就分享一下吧!

評論

作者其他優質文章

正在加載中
  • 推薦
  • 評論
  • 收藏
  • 共同學習,寫下你的評論
感謝您的支持,我會繼續努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦
今天注冊有機會得

100積分直接送

付費專欄免費學

大額優惠券免費領

立即參與 放棄機會
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號

舉報

0/150
提交
取消