Clinwright Public work of Helper Software LLC · free Start free

14.3.4.4

Summary of ECG Parameters by Visit

Made 2026-10-17 from simulated data.

ONCO-EX

Table 14.3.4.4

Summary of ECG Parameters by Visit

Safety Analysis Set

Standard of Care (N=150)Clinwrightinib 200 mg (N=150)
nMean (SD)Change Mean (SD)nMean (SD)Change Mean (SD)
Parameter: Heart Rate (beats/min)
Baseline15075.9 (10.13)- (-)15077.0 (11.55)- (-)
Week 128075.9 (11.67)0.5 (12.00)11376.5 (11.57)-1.6 (12.43)
Week 247975.4 (11.24)0.0 (12.04)10875.9 (11.53)-2.9 (11.86)
Week 364675.8 (10.05)-0.6 (12.51)8176.8 (10.37)-2.4 (13.78)
Week 482673.9 (8.25)-2.3 (9.33)6175.3 (10.25)-3.0 (14.61)
Parameter: PR Interval (msec)
Baseline150164.3 (21.39)- (-)150165.4 (22.35)- (-)
Week 1280162.6 (21.87)0.9 (21.90)111163.6 (21.89)-1.3 (21.73)
Week 2479162.3 (22.36)0.1 (19.07)108165.9 (24.11)0.7 (22.44)
Week 3645165.9 (20.41)5.8 (24.85)81163.2 (22.50)-4.1 (20.89)
Week 4826166.9 (19.87)2.8 (24.10)62162.4 (24.76)-4.8 (24.04)
Parameter: QRS Duration (msec)
Baseline15092.6 (10.92)- (-)15094.4 (10.82)- (-)
Week 128094.1 (12.41)1.5 (11.58)11295.9 (10.17)0.6 (10.44)
Week 247994.1 (11.02)1.4 (9.70)10894.7 (11.38)-0.8 (10.41)
Week 364794.1 (10.01)1.4 (10.69)8194.6 (10.46)0.0 (9.10)
Week 482794.6 (9.67)3.0 (12.24)6294.1 (11.09)-1.6 (11.07)
Parameter: QT Interval (msec)
Baseline150382.5 (29.18)- (-)150397.8 (27.86)- (-)
Week 1281391.2 (28.52)8.3 (29.23)113392.9 (27.96)-6.5 (35.03)
Week 2479391.1 (27.65)8.6 (25.77)108393.7 (25.77)-5.2 (31.11)
Week 3647384.7 (28.60)-0.8 (31.70)81389.5 (30.81)-6.6 (36.47)
Week 4827379.2 (27.06)-7.0 (30.26)61389.7 (28.24)-2.8 (34.37)
Parameter: QTcF Interval (msec)
Baseline150419.5 (16.97)- (-)150417.3 (18.16)- (-)
Week 1279419.4 (16.85)-0.9 (16.64)110419.0 (17.83)3.7 (17.67)
Week 2477419.0 (15.95)-2.2 (16.41)108420.7 (18.44)5.0 (18.53)
Week 3647422.0 (14.29)2.1 (15.65)81424.1 (18.45)9.1 (18.55)
Week 4827417.9 (17.24)-0.3 (12.32)62426.0 (16.63)10.5 (19.99)

Change: from baseline.

Source: ADEG.

Program: t-14-3-4-4.sas

Program t-14-3-4-4.sas

Version 1, written from Clinwright's patterns, 2026-10-17, checks passed.

/*==== 00-header ====*/
/*----------------------------------------------------------------------------
  Output  : Table 14.3.4.4 / Summary of ECG Parameters by Visit / Safety Analysis Set
  Program : t-14-3-4-4.sas   Reporting effort : CSR
  ADaM    : /work/adam (ADSL, ADLBC, ADLBH, ADVS, ADAE, ADEG, ADCM, ADMH, ADEX, ADRS, ADTR, ADTTE)
  The header and the report step follow from the shell. The sections between
  them make WORK.FINAL, one record per row of the table, in order:
    _page     the page (1 unless the output is paged); _pagelbl its heading or empty
    _ord      the row's order; _indent the label's indentation (0 = flush left)
    _rowid    the uuid of the shell row it shows (WORK._SHELL); one shell row may
              have several (a category per value); a blank row's is blank-<n>
    _kind     label | stat | blank
    rowlabel  the row's label, as text
    col1      n
    col2      Mean (SD)
    col3      Change|Mean (SD)
    col4      n
    col5      Mean (SD)
    col6      Change|Mean (SD)
  and set the big N of the column headers:
    &_bign1_3  Standard of Care|(N=xx)
    &_bign4_6  Clinwrightinib 200 mg|(N=xx)
  /work/_lib/clinwright.sas has %ls_bign, %ls_count, %ls_stats, %ls_npct, %ls_num.
----------------------------------------------------------------------------*/
libname adam "/work/adam" access=readonly;
%include "/work/_lib/clinwright.sas";
%ls_setup;

/* The shell's rows, in order, with each column's value pattern (_xx1-_xx6). */
data work._shell;
  length _page 8 _pagelbl $200 _ord 8 _indent 8 _rowid $36 _kind $5 _var $32 rowlabel $200 _xx1 $40 _xx2 $40 _xx3 $40 _xx4 $40 _xx5 $40 _xx6 $40;
  _page = 1; _pagelbl = '';
  _ord=1; _indent=0; _rowid='07607494-20c5-4fad-8620-94e51e66ce59'; _kind='stat'; _var='AVISIT'; rowlabel='[Visit]'; _xx1='xx'; _xx2='xx.x (xx.xx)'; _xx3='xx.x (xx.xx)'; _xx4='xx'; _xx5='xx.x (xx.xx)'; _xx6='xx.x (xx.xx)'; output;
run;

/*==== 10-data ====*/
/* Made from the output's analysis: the records of ADEG of the subjects of ADSL with SAFFL = 'Y', by TRT01A. */
/* The population's subjects, in each column they count in. */
data work._popc;
  set adam.adsl(where=(saffl = 'Y'));
  if trt01a in ('Standard of Care') then do; _col = 1; output; end;
  if trt01a in ('Standard of Care') then do; _col = 2; output; end;
  if trt01a in ('Standard of Care') then do; _col = 3; output; end;
  if trt01a in ('Clinwrightinib 200 mg') then do; _col = 4; output; end;
  if trt01a in ('Clinwrightinib 200 mg') then do; _col = 5; output; end;
  if trt01a in ('Clinwrightinib 200 mg') then do; _col = 6; output; end;
  keep usubjid _col;
run;
data work._pop1; set adam.adsl(where=(saffl = 'Y')); keep usubjid trt01a; run;
proc sort data=work._pop1; by usubjid; run;
/* The records of ADEG, of the population's subjects, in each column. */
proc sort data=adam.adeg(keep=usubjid saffl param paramn avisit avisitn aval chg visit) out=work._rec; by usubjid; run;
data work._an;
  merge work._rec(in=_r) work._pop1(in=_p);
  by usubjid;
  if _r and _p;
  if trt01a in ('Standard of Care') then do; _col = 1; output; end;
  if trt01a in ('Standard of Care') then do; _col = 2; output; end;
  if trt01a in ('Standard of Care') then do; _col = 3; output; end;
  if trt01a in ('Clinwrightinib 200 mg') then do; _col = 4; output; end;
  if trt01a in ('Clinwrightinib 200 mg') then do; _col = 5; output; end;
  if trt01a in ('Clinwrightinib 200 mg') then do; _col = 6; output; end;
run;
data work._cols; do _col = 1 to 6; output; end; run;
%ls_bign(data=work._popc, trt=_col, values=1|2|3|4|5|6|1 2 3|4 5 6, names=_lsn1 _lsn2 _lsn3 _lsn4 _lsn5 _lsn6 _bign1_3 _bign4_6);

/* Subjects and records per column. */
proc sort data=work._an(keep=usubjid _col) out=work._u; by _col usubjid; run;
data work._c;
  set work._u;
  by _col usubjid;
  retain _n _e;
  if first._col then do; _n = 0; _e = 0; end;
  _e = _e + 1;
  if first.usubjid then _n = _n + 1;
  if last._col then output;
  keep _col _n _e;
run;
proc transpose data=work._c out=work._tn(drop=_name_) prefix=_n; id _col; var _n; run;
proc transpose data=work._c out=work._te(drop=_name_) prefix=_e; id _col; var _e; run;
data work._z; _z = 1; run;
data work._g2;
  merge work._z work._tn work._te;
  array _nn{6} _n1-_n6;
  array _ee{6} _e1-_e6;
  do _i = 1 to 6; _nn{_i} = sum(_nn{_i}, 0); _ee{_i} = sum(_ee{_i}, 0); end;
  _tot = sum(of _n1-_n6);
  drop _i _z;
run;
/* Per value of param: subjects and records per column. */
proc sort data=work._an(keep=usubjid _col param paramn where=(not missing(param))) out=work._u; by param _col usubjid; run;
data work._c;
  set work._u;
  by param _col usubjid;
  retain _n _e;
  if first._col then do; _n = 0; _e = 0; end;
  _e = _e + 1;
  if first.usubjid then _n = _n + 1;
  if last._col then output;
  keep param paramn _col _n _e;
run;
proc transpose data=work._c out=work._tn(drop=_name_) prefix=_n; by param paramn; id _col; var _n; run;
proc transpose data=work._c out=work._te(drop=_name_) prefix=_e; by param paramn; id _col; var _e; run;
data work._g1;
  merge work._tn work._te; by param paramn;
  array _nn{6} _n1-_n6;
  array _ee{6} _e1-_e6;
  do _i = 1 to 6; _nn{_i} = sum(_nn{_i}, 0); _ee{_i} = sum(_ee{_i}, 0); end;
  _tot = sum(of _n1-_n6);
  drop _i;
run;
proc sort data=work._g1; by paramn param; run;
data work._g1;
  set work._g1;
  _o1 = _n_;
run;
/* Per value of param and avisit: subjects and records per column. */
proc sort data=work._an(keep=usubjid _col param avisit avisitn where=(not missing(param) and not missing(avisit))) out=work._u; by param avisit _col usubjid; run;
data work._c;
  set work._u;
  by param avisit _col usubjid;
  retain _n _e;
  if first._col then do; _n = 0; _e = 0; end;
  _e = _e + 1;
  if first.usubjid then _n = _n + 1;
  if last._col then output;
  keep param avisit avisitn _col _n _e;
run;
proc transpose data=work._c out=work._tn(drop=_name_) prefix=_n; by param avisit avisitn; id _col; var _n; run;
proc transpose data=work._c out=work._te(drop=_name_) prefix=_e; by param avisit avisitn; id _col; var _e; run;
data work._g0;
  merge work._tn work._te; by param avisit avisitn;
  array _nn{6} _n1-_n6;
  array _ee{6} _e1-_e6;
  do _i = 1 to 6; _nn{_i} = sum(_nn{_i}, 0); _ee{_i} = sum(_ee{_i}, 0); end;
  _tot = sum(of _n1-_n6);
  drop _i;
run;
proc sort data=work._g0; by param avisitn avisit; run;
data work._g0;
  set work._g0;
  by param;
  retain _r;
  if first.param then _r = 0;
  _r = _r + 1;
  _o2 = _r;
  drop _r;
run;
proc sort data=work._g0; by param; run;
proc sort data=work._g1(keep=param _o1) out=work._gp; by param; run;
data work._g0; merge work._g0(in=_in) work._gp; by param; if _in; run;
/* [Visit] of AVISIT. */
data work._f; set work._g0; do _col = 1 to 6; output; end; run;
proc sort data=work._f; by param avisit _col; run;
%ls_stats(data=work._an, out=work._cs0, var=aval, trt=_col, by=param avisit, keepraw=Y);
data work._cs0;
  set work._cs0(rename=(_vn=_c0n _vmean=_c0mean _vsd=_c0sd _vmedian=_c0median _vq1=_c0q1 _vq3=_c0q3 _vmin=_c0min _vmax=_c0max _vcv=_c0cv _vgmean=_c0gmean _vgcv=_c0gcv _vglo=_c0glo _vghi=_c0ghi));
  keep param avisit _col _c0n _c0mean _c0sd _c0median _c0q1 _c0q3 _c0min _c0max _c0cv _c0gmean _c0gcv _c0glo _c0ghi;
run;
%ls_stats(data=work._an, out=work._cs1, var=chg, trt=_col, by=param avisit, keepraw=Y);
data work._cs1;
  set work._cs1(rename=(_vn=_c1n _vmean=_c1mean _vsd=_c1sd _vmedian=_c1median _vq1=_c1q1 _vq3=_c1q3 _vmin=_c1min _vmax=_c1max _vcv=_c1cv _vgmean=_c1gmean _vgcv=_c1gcv _vglo=_c1glo _vghi=_c1ghi));
  keep param avisit _col _c1n _c1mean _c1sd _c1median _c1q1 _c1q3 _c1min _c1max _c1cv _c1gmean _c1gcv _c1glo _c1ghi;
run;
data work._k1;
  length _rowid $36 _label _pagelbl $200 _v $200;
  merge work._f(in=_in) work._cs0 work._cs1;
  by param avisit _col;
  if _in;
  array _nn{6} _n1-_n6;
  array _ee{6} _e1-_e6;
  _rowid = '07607494-20c5-4fad-8620-94e51e66ce59';
  _page = _o1;
  _pagelbl = 'Parameter: ' || strip(param);
  _k0 = 1;
  _k1 = _o2; _k2 = 0;
  _label = strip(avisit);
  if _col = 1 then _v = strip(ifc(missing(sum(_c0n, 0)), '-', %ls_num(sum(_c0n, 0), 0)));
  else if _col = 2 then _v = strip(ifc(missing(_c0mean), '-', %ls_num(_c0mean, 1))) || ' (' || strip(ifc(missing(_c0sd), '-', %ls_num(_c0sd, 2))) || ')';
  else if _col = 3 then _v = strip(ifc(missing(_c1mean), '-', %ls_num(_c1mean, 1))) || ' (' || strip(ifc(missing(_c1sd), '-', %ls_num(_c1sd, 2))) || ')';
  else if _col = 4 then _v = strip(ifc(missing(sum(_c0n, 0)), '-', %ls_num(sum(_c0n, 0), 0)));
  else if _col = 5 then _v = strip(ifc(missing(_c0mean), '-', %ls_num(_c0mean, 1))) || ' (' || strip(ifc(missing(_c0sd), '-', %ls_num(_c0sd, 2))) || ')';
  else if _col = 6 then _v = strip(ifc(missing(_c1mean), '-', %ls_num(_c1mean, 1))) || ' (' || strip(ifc(missing(_c1sd), '-', %ls_num(_c1sd, 2))) || ')';
  keep _rowid _label _page _pagelbl _k0 _k1 _k2 _col _v;
run;

data work._cells; set work._k1; run;
proc sort data=work._cells; by _page _pagelbl _k0 _k1 _k2 _rowid _label _col; run;
proc transpose data=work._cells out=work._wide(drop=_name_) prefix=col;
  by _page _pagelbl _k0 _k1 _k2 _rowid _label;
  id _col;
  var _v;
run;
proc sort data=work._wide; by _rowid; run;
proc sort data=work._shell(drop=_page _pagelbl) out=work._rows; by _rowid; run;
data work._inst;
  merge work._wide(in=_w) work._rows(in=_s);
  by _rowid;
  if _w and _s;
  if _label ne '' then rowlabel = _label;
run;
data work._fixed;
  set work._shell;
  if _rowid not in ('07607494-20c5-4fad-8620-94e51e66ce59');
  _k0 = _ord; _k1 = 0; _k2 = 0;
run;
data work.final;
  length col1 col2 col3 col4 col5 col6 $200 _pagelbl $200;
  set work._inst work._fixed;
run;
proc sort data=work.final; by _page _k0 _k1 _k2; run;
data work.final;
  set work.final;
  _ord = _n_;
  keep _page _pagelbl _ord _indent _rowid _kind rowlabel col1 col2 col3 col4 col5 col6;
run;

/*==== 90-report ====*/
/* 90-report: from the shell; the titles, columns, headers and footnotes are not changed here. */
%ls_need(_bign1_3 _bign4_6);
%ls_final_check(columns=_page _pagelbl _ord _indent _rowid _kind rowlabel col1 col2 col3 col4 col5 col6);
proc sort data=work.final out=work._report; by _page _ord; run;
data work._report;
  set work._report;
  /* Two spaces per step of indentation: the label column keeps leading spaces (asis=on). */
  if _indent > 0 then rowlabel = repeat(' ', 2 * _indent - 1) || rowlabel;
run;
%let _lspaged = 0;
proc sql noprint; select count(*) into :_lspaged trimmed from work._report where _pagelbl ne ''; quit;

options orientation=landscape;
ods listing close;
ods rtf file="/work/out/t-14-3-4-4.rtf" style=journal;
title1 j=l "ONCO-EX" j=r "Page ~{thispage} of ~{lastpage}";
title2 j=c "Table 14.3.4.4";
title3 j=c "Summary of ECG Parameters by Visit";
title4 j=c "Safety Analysis Set";
footnote1 j=l "Change: from baseline.";
footnote2 j=l "Source: ADEG.";
footnote3 j=l "Program: t-14-3-4-4.sas";
%macro _ls_report;
proc report data=work._report nowd split='|' missing style(report)={width=100%};
  column _page _pagelbl _ord _indent _kind rowlabel ("Standard of Care|(N=&_bign1_3.)" col1 col2 col3) ("Clinwrightinib 200 mg|(N=&_bign4_6.)" col4 col5 col6);
  define _page / order order=internal noprint;
  define _pagelbl / order noprint;
  define _ord / order order=internal noprint;
  define _indent / display noprint;
  define _kind / display noprint;
  define rowlabel / display "" style(column)={cellwidth=40% asis=on} style(header)={just=l};
  define col1 / display "n" style(column)={cellwidth=10% just=c} style(header)={just=c};
  define col2 / display "Mean (SD)" style(column)={cellwidth=10% just=c} style(header)={just=c};
  define col3 / display "Change|Mean (SD)" style(column)={cellwidth=10% just=c} style(header)={just=c};
  define col4 / display "n" style(column)={cellwidth=10% just=c} style(header)={just=c};
  define col5 / display "Mean (SD)" style(column)={cellwidth=10% just=c} style(header)={just=c};
  define col6 / display "Change|Mean (SD)" style(column)={cellwidth=10% just=c} style(header)={just=c};
  %if &_lspaged > 0 %then %do;
  compute before _pagelbl / style={just=l};
    line _pagelbl $200.;
  endcomp;
  %end;
  break after _page / page;
run;
%mend _ls_report;
%_ls_report;
ods rtf close;
ods listing;
%ls_final_export;