/****************************************************************************** * TABLE : t_ada_impact_pk (Single-/Fixed-Sequence, e.g. DDI) * TITLE : Impact of Anti-Drug Antibody (ADA) Status on Plasma PK Exposure * by Period * POPULATION: PK Population (PKFL='Y') with ADA result (ADA-evaluable) * INPUT : ADPP (PARAMCD = CMAX, AUCLST, AUCIFO, ...) merged with per-PERIOD * ADA status from ADIS (matched on USUBJID and APERIOD) * NOTE : PSEUDOCODE. Single-/fixed-sequence (no randomized sequence): * column = fixed PERIOD (APERIOD/APERIODC; Period 1 = reference, * subsequent period(s) = test); within each period, exposure PK * parameters summarized by ADA status (ADA-positive vs * ADA-negative). PK stats = arithmetic n, Mean, SD, CV%, Geo Mean, * Geo CV%, Median, Min, Max. Tmax (if shown) = Median (Min, Max) * only. Comparison is DESCRIPTIVE (subgroup exposure by ADA status), * not an inferential test. ******************************************************************************/ %include "../00_setup_macros.sas"; %setup(study=CP-101, adam=/data/adam, out=/data/tfl); %designvars(design=SINGLESEQ); /* column = APERIODC (fixed period) */ /*--- per-PERIOD ADA status from ADIS (carry APERIOD) --------------------* * ADA status is matched PER PERIOD (a participant may be ADA-positive in the test * period but negative in the reference period). Carrying APERIOD here prevents * a single participant-level label from contaminating both period columns. */ proc sql; create table _adastat as select USUBJID, APERIOD, /* ADaM-provided overall ADA status flag mapped to label: 'ADA-positive' / 'ADA-negative' (treatment-emergent basis) */ max(case when ADAEMFL='Y' then 1 else 0 end) as adaemn from adam.adis where ADAFL='Y' group by USUBJID, APERIOD; quit; /*--- PK parameters + ADA group; keep exposure params for this table ------ * APERIOD/APERIODC retained from ADPP so exposure is read out per fixed period; * ADA status joined on USUBJID AND APERIOD (per-period match). */ proc sql; create table pp as select p.*, case when a.adaemn=1 then 'ADA-positive' when a.adaemn=0 then 'ADA-negative' else 'ADA status unknown' end as ADAGRP length=20 from adam.adpp(where=(PKFL='Y' and PARAMCD in ('CMAX','AUCLST','AUCIFO','TMAX'))) p left join _adastat a on p.USUBJID=a.USUBJID and p.APERIOD=a.APERIOD; quit; data pp; set pp; tmaxfl = (PARAMCD='TMAX'); /* Tmax -> median (min,max) */ if AVAL>0 then logv = log(AVAL); /* log value for geometric stats */ run; /*--- arithmetic + geometric summary by period x ADA group x parameter ---- * Reuse %pkstats pattern: arithmetic n/Mean/SD/CV% + geometric on log scale */ proc means data=pp(where=(tmaxfl=0)) noprint; class &BYPERIOD ADAGRP PARAMCD PARAM; var AVAL; output out=_arith n=n mean=mean std=std min=min max=max cv=cv; run; /* geometric: PROC MEANS on log(AVAL), AVAL>0; GeoMean=exp(mean_log), GeoCV%=100*sqrt(exp(var_log)-1) */ proc means data=pp(where=(tmaxfl=0 and AVAL>0)) noprint; class &BYPERIOD ADAGRP PARAMCD; var logv; /* log(AVAL) */ output out=_geo mean=gmean_log std=gsd_log; /* on logVAL */ run; data _cont; merge _arith _geo; by APERIOD ADAGRP PARAMCD; length stat $14 value $30; /* round to ADaM decimal hints; build display rows: n / Mean / SD / CV% / Geo Mean / Geo CV% / Median / Min / Max */ run; /*--- Tmax: Median (Min, Max) only ---------------------------------------*/ proc means data=pp(where=(tmaxfl=1)) noprint; class &BYPERIOD ADAGRP PARAMCD; var AVAL; output out=_tmax median=med min=min max=max; run; data _tmaxd; set _tmax; length stat $14 value $30; stat='Median (Min, Max)'; value=catx(' ', put(med,8.2), cats('(',put(min,8.2),', ',put(max,8.2),')')); run; /*--- stack params (rows) x [period x ADA group] (cols) ------------------*/ data _all; set _cont _tmaxd; run; proc sort data=_all; by PARAM PARAMCD stat APERIOD ADAGRP; run; proc transpose data=_all out=_wide; by PARAM PARAMCD stat; id APERIOD ADAGRP; /* period x ADA-status columns */ var value; run; %tfltitle(num=14.5.2.1, type=Table, text=%str(Impact of Anti-Drug Antibody (ADA) Status on Plasma PK Exposure by Period), pop=Pharmacokinetic Population with ADA Result, foot=%str(Exposure parameters summarized by ADA status (positive/negative) within each fixed period (APERIODC; Period 1 = reference, subsequent period(s) = test). CV% arithmetic; Geo CV% = 100*sqrt(exp(s^2_log)-1). Tmax: Median (Min, Max). Descriptive subgroup comparison; single-/fixed-sequence.)); proc report data=_wide nowd split='|'; columns PARAM PARAMCD stat ("By Period and ADA Status" /* period x ADA cols */); define PARAM / order 'Parameter (units)' width=26; define PARAMCD / order noprint; define stat / display 'Statistic' width=16; run;