ADNPIX
NPI-X Item Analysis Data
BASIC DATA STRUCTURE · one record per subject per parameter per analysis visit per analysis date · keys USUBJID, PARAMCD, AVISIT, ADT, QSSEQ
Variables
| Variable | Label | Type | Length | Derivation |
|---|---|---|---|---|
STUDYID | Study Identifier | text | Predecessor ADSL.STUDYID | |
SITEID | Study Site Identifier | text | Predecessor ADSL.SITEID | |
SITEGR1 | Pooled Site Group 1 | text | Predecessor ADSL.SITEGR1 | |
USUBJID | Unique Subject Identifier | text | Predecessor QS.USUBJID | |
TRTSDT | Date of First Exposure to Treatment | integer | 8 | Predecessor ADSL.TRTSDT |
TRTEDT | Date of Last Exposure to Treatment | integer | 8 | Predecessor ADSL.TRTEDT |
TRTP | Planned Treatment | text | Predecessor ADSL.TRT01P | |
TRTPN | Planned Treatment (N) | integer | 8 | Predecessor ADSL.TRT01PN |
AGE | Age | integer | 8 | Predecessor ADSL.AGE |
AGEGR1 | Pooled Age Group 1 | text | Predecessor ADSL.AGEGR1 | |
AGEGR1N | Pooled Age Group 1 (N) | integer | 8 | Predecessor ADSL.AGEGR1N |
RACE | Race | text | Predecessor ADSL.RACE | |
RACEN | Race (N) | integer | 8 | Predecessor ADSL.RACEN |
SEX | Sex | text | Predecessor ADSL.SEX | |
ITTFL | Intent-to-Treat Population Flag | text | Predecessor ADSL.ITTFL | |
EFFFL | Efficacy Population Flag | text | Predecessor ADSL.EFFFL | |
COMP24FL | Completers of Week 24 Population Flag | text | Predecessor ADSL.COMP24FL | |
AVISIT | Analysis Visit | text | Character version of the visit. | |
AVISITN | Analysis Visit (N) | integer | 8 | Using window method in SAP Page 10 to determine AVISITN value based on ADY. |
ADY | Analysis Relative Day | integer | 8 | ADY = ADT - TRTSDT + 1, if ADT>=TRTSDT. ADY = ADT - TRTSDT, if ADT<TRTSDT. |
ADT | Analysis Date | integer | 8 | SAS date from QS.QSDTC |
VISITNUM | Visit Number | float | 8 | Predecessor QS.VISITNUM |
VISIT | Visit Name | text | Predecessor QS.VISIT | |
PARAM | Parameter | text | Predecessor QS.QSTEST | |
PARAMCD | Parameter Code | text | Predecessor QS.QSTESTCD | |
PARAMN | Parameter (N) | integer | 8 | Assigned Sponsor |
PARAMTYP | Parameter Type | text | Assigned Sponsor | |
AVAL | Analysis Value | integer | 8 | |
BASE | Baseline Value | integer | 8 | QS.QSSTRESN when QS.QSBLFL=Y. |
CHG | Change from Baseline | integer | 8 | AVAL - BASE, for post baseline records. |
PCHG | Percent Change from Baseline | integer | 8 | 100* (CHG/BASE), for post baseline records. |
ABLFL | Baseline Record Flag | text | Predecessor QS.QSBLFL | |
ANL01FL | Analysis Flag 01 | text | Set ANL01FL=Y based on SAP Page 10 analysis windows. | |
DTYPE | Derivation Type | text | Assigned Sponsor | |
AWRANGE | Analysis Window Valid Relative Range | text | Window range, specified in the SAP Page 10. | |
AWTARGET | Analysis Window Target | integer | 8 | Target day within the window, specified in the SAP Page 10. |
AWTDIFF | Analysis Window Diff from Target | integer | 8 | Absolute difference between AWTARGET and ADY |
AWLO | Analysis Window Beginning Timepoint | integer | 8 | Start day of the window, specified in the SAP Page 10. |
AWHI | Analysis Window Ending Timepoint | integer | 8 | End day of the window, specified in the SAP Page 10. |
AWU | Analysis Window Unit | text | Assigned as "DAYS". | |
QSSEQ | Sequence Number | integer | 8 | Predecessor QS.QSSEQ |
Program adnpix.sas
Version 1, written from Clinwright's patterns, 2026-10-17, checks passed.
/*==== 00-header ====*/
/*----------------------------------------------------------------------------
Data set : ADNPIX (NPI-X Item Analysis Data)
Reporting effort : CSR
ADaM : ADSL
The header and the finalize step follow from the specification.
----------------------------------------------------------------------------*/
libname sdtm "/work/sdtm" access=readonly;
libname adam "/work/adam";
options validvarname=upcase nofmterr msglevel=i;
/*==== 10-inputs ====*/
/* The QS records of the parameters PARAMCD's codelist lists, with the subject's TRTSDT, TRTEDT, STUDYID, SITEID, SITEGR1, TRT01P, TRT01PN, AGE, AGEGR1, AGEGR1N, RACE, RACEN, SEX, ITTFL, EFFFL, COMP24FL from ADSL. */
proc sort data=sdtm.qs(keep=studyid usubjid qsseq qstestcd qstest qsstresn qsblfl visitnum visit qsdtc where=(qstestcd in ('NPITM01S', 'NPITM02S', 'NPITM03S', 'NPITM04S', 'NPITM05S', 'NPITM06S', 'NPITM07S', 'NPITM08S', 'NPITM09S', 'NPITM10S', 'NPITM11S', 'NPITM12S', 'NPTOT'))) out=work._ds; by usubjid; run;
proc sort data=adam.adsl(keep=usubjid trtsdt trtedt studyid siteid sitegr1 trt01p trt01pn age agegr1 agegr1n race racen sex ittfl efffl comp24fl) out=work._adsl; by usubjid; run;
data work._ds;
merge work._ds(in=_in) work._adsl;
by usubjid;
if _in;
length trtp $200;
trtp = trt01p;
trtpn = trt01pn;
length param $200;
select (upcase(qstestcd));
when ('NPITM01S') param = 'NPI-X Item A (Delusion) Score';
when ('NPITM02S') param = 'NPI-X Item B (Hallucination) Score';
when ('NPITM03S') param = 'NPI-X Item C (Agitation/Agression) Score';
when ('NPITM04S') param = 'NPI-X Item D (Depression/Dysphoria) Score';
when ('NPITM05S') param = 'NPI-X Item E (Anxiety) Score';
when ('NPITM06S') param = 'NPI-X Item F (Eupohoria/Elation) Score';
when ('NPITM07S') param = 'NPI-X Item G (Apathy/Indifference) Score';
when ('NPITM08S') param = 'NPI-X Item H (Disinhibition) Score';
when ('NPITM09S') param = 'NPI-X Item I (Irritability/Lability) Score';
when ('NPITM10S') param = 'NPI-X Item J (Aberrant Motor Behavior) Score';
when ('NPITM11S') param = 'NPI-X Item K (Night-time Behavior) Score';
when ('NPITM12S') param = 'NPI-X Item L (Appetite/Eating Change) Score';
when ('NPTOT') param = 'NPI-X (9) Total Score';
otherwise param = '';
end;
if param = '' then do;
select (upcase(qstest));
when ('NPI-X ITEM A (DELUSION) SCORE') param = 'NPI-X Item A (Delusion) Score';
when ('NPI-X ITEM B (HALLUCINATION) SCORE') param = 'NPI-X Item B (Hallucination) Score';
when ('NPI-X ITEM C (AGITATION/AGRESSION) SCORE') param = 'NPI-X Item C (Agitation/Agression) Score';
when ('NPI-X ITEM D (DEPRESSION/DYSPHORIA) SCORE', 'NPI-X ITEM D (DEPRESSION/DYSPHORIA) SCOR') param = 'NPI-X Item D (Depression/Dysphoria) Score';
when ('NPI-X ITEM E (ANXIETY) SCORE') param = 'NPI-X Item E (Anxiety) Score';
when ('NPI-X ITEM F (EUPOHORIA/ELATION) SCORE') param = 'NPI-X Item F (Eupohoria/Elation) Score';
when ('NPI-X ITEM G (APATHY/INDIFFERENCE) SCORE') param = 'NPI-X Item G (Apathy/Indifference) Score';
when ('NPI-X ITEM H (DISINHIBITION) SCORE') param = 'NPI-X Item H (Disinhibition) Score';
when ('NPI-X ITEM I (IRRITABILITY/LABILITY) SCORE', 'NPI-X ITEM I (IRRITABILITY/LABILITY) SCO') param = 'NPI-X Item I (Irritability/Lability) Score';
when ('NPI-X ITEM J (ABERRANT MOTOR BEHAVIOR) SCORE', 'NPI-X ITEM J (ABERRANT MOTOR BEHAVIOR) S') param = 'NPI-X Item J (Aberrant Motor Behavior) Score';
when ('NPI-X ITEM K (NIGHT-TIME BEHAVIOR) SCORE') param = 'NPI-X Item K (Night-time Behavior) Score';
when ('NPI-X ITEM L (APPETITE/EATING CHANGE) SCORE', 'NPI-X ITEM L (APPETITE/EATING CHANGE) SC') param = 'NPI-X Item L (Appetite/Eating Change) Score';
when ('NPI-X (9) TOTAL SCORE') param = 'NPI-X (9) Total Score';
when ('MEAN NPI-X', 'MEAN NPI-X (9) TOTAL (WEEK 4 TO 24)') param = 'Mean NPI-X (9) Total (Week 4 to 24)';
otherwise param = qstest;
end;
end;
length paramcd $200;
paramcd = qstestcd;
aval = qsstresn;
length ablfl $200;
ablfl = qsblfl;
run;
/*==== 20-parameters ====*/
/* PARAMN: the code of PARAM. */
proc format;
invalue paramn_ (upcase just)
"NPI-X ITEM A (DELUSION) SCORE" = 1
"NPI-X ITEM B (HALLUCINATION) SCORE" = 2
"NPI-X ITEM C (AGITATION/AGRESSION) SCORE" = 3
"NPI-X ITEM D (DEPRESSION/DYSPHORIA) SCORE" = 4
"NPI-X ITEM E (ANXIETY) SCORE" = 5
"NPI-X ITEM F (EUPOHORIA/ELATION) SCORE" = 6
"NPI-X ITEM G (APATHY/INDIFFERENCE) SCORE" = 7
"NPI-X ITEM H (DISINHIBITION) SCORE" = 8
"NPI-X ITEM I (IRRITABILITY/LABILITY) SCORE" = 9
"NPI-X ITEM J (ABERRANT MOTOR BEHAVIOR) SCORE" = 10
"NPI-X ITEM K (NIGHT-TIME BEHAVIOR) SCORE" = 11
"NPI-X ITEM L (APPETITE/EATING CHANGE) SCORE" = 12
"NPI-X (9) TOTAL SCORE" = 13
"MEAN NPI-X (9) TOTAL (WEEK 4 TO 24)" = 14
other = .;
run;
data work._ds;
set work._ds;
if param ne '' then paramn = input(param, paramn_.);
run;
/*==== 25-derived-parameters ====*/
/* AVAL[NPTOTMN] (Mean NPI-X (9) Total (Week 4 to 24)): take the mean of AVAL when PARAMCD=NPTOT from week 4 to 24. -- to write. */
/*==== 30-timing ====*/
/* ADT: QS.QSDTC as a SAS date. */
data work._ds;
set work._ds;
length _dtc $10;
_dtc = qsdtc; /* (its first 10 characters: SUBSTR would complain of a shorter variable) */
if length(_dtc) = 10 then adt = input(_dtc, ?? yymmdd10.);
format adt date9.;
drop _dtc;
run;
/* ADY: day of ADT relative to TRTSDT; no day 0. */
data work._ds;
set work._ds;
if nmiss(adt, trtsdt) = 0 then ady = adt - trtsdt + (adt >= trtsdt);
run;
/*==== 40-visits ====*/
/* AVISIT: the analysis visit whose window holds ADY (Baseline <=1, Week 2 2-21, Week 4 22-35, Week 6 36-49, Week 8 50-70, Week 12 71-98, Week 16 99-126, Week 20 127-154, Week 24 155-175, Week 26 >175). */
data work._ds;
set work._ds;
length avisit $40 awrange $20 awu $4;
if missing(ady) then call missing(avisit, avisitn);
else if ady <= 1 then do;
avisit = "Baseline"; avisitn = 0; awtarget = 1; awlo = .; awhi = 1; awrange = "<=1";
end;
else if 2 <= ady <= 21 then do;
avisit = "Week 2"; avisitn = 2; awtarget = 14; awlo = 2; awhi = 21; awrange = "2-21";
end;
else if 22 <= ady <= 35 then do;
avisit = "Week 4"; avisitn = 4; awtarget = 28; awlo = 22; awhi = 35; awrange = "22-35";
end;
else if 36 <= ady <= 49 then do;
avisit = "Week 6"; avisitn = 6; awtarget = 42; awlo = 36; awhi = 49; awrange = "36-49";
end;
else if 50 <= ady <= 70 then do;
avisit = "Week 8"; avisitn = 8; awtarget = 56; awlo = 50; awhi = 70; awrange = "50-70";
end;
else if 71 <= ady <= 98 then do;
avisit = "Week 12"; avisitn = 12; awtarget = 84; awlo = 71; awhi = 98; awrange = "71-98";
end;
else if 99 <= ady <= 126 then do;
avisit = "Week 16"; avisitn = 16; awtarget = 112; awlo = 99; awhi = 126; awrange = "99-126";
end;
else if 127 <= ady <= 154 then do;
avisit = "Week 20"; avisitn = 20; awtarget = 140; awlo = 127; awhi = 154; awrange = "127-154";
end;
else if 155 <= ady <= 175 then do;
avisit = "Week 24"; avisitn = 24; awtarget = 168; awlo = 155; awhi = 175; awrange = "155-175";
end;
else if 176 <= ady then do;
avisit = "Week 26"; avisitn = 26; awtarget = 182; awlo = 176; awhi = .; awrange = ">175";
end;
if not missing(avisitn) then do;
awtdiff = abs(ady - awtarget);
awu = 'DAYS';
end;
run;
/*==== 50-baseline ====*/
/* BASE: AVAL of the baseline record (ABLFL = 'Y'), per subject and PARAMCD. */
proc sort data=work._ds; by usubjid paramcd; run;
data work._base(keep=usubjid paramcd base);
set work._ds(where=(ablfl = 'Y'));
base = aval;
run;
data work._ds;
merge work._ds work._base;
by usubjid paramcd;
run;
/* The baseline record without an analysis visit (a screening value, the test not done on the day of the first dose): the Baseline analysis visit. */
data work._ds;
set work._ds;
if ablfl = 'Y' and missing(avisit) then do; avisit = 'Baseline'; avisitn = 0; _blvis = 1; end;
run;
/* (Then a record of the same subject and PARAMCD at the Baseline visit that is not the baseline, the day of the first dose without a value: no analysis visit.) */
proc sort data=work._ds; by usubjid paramcd descending _blvis; run;
data work._ds;
set work._ds;
by usubjid paramcd;
retain _blmov;
if first.paramcd then _blmov = (_blvis = 1);
if _blmov and ablfl ne 'Y' and avisit = 'Baseline' then call missing(avisit, avisitn);
drop _blvis _blmov;
run;
/* CHG: AVAL - BASE, after baseline only. */
data work._ds;
set work._ds;
if nmiss(aval, base) = 0 and ablfl ne 'Y' and adt > trtsdt then chg = aval - base;
run;
/* PCHG: 100 * CHG / BASE, where BASE is not 0. */
data work._ds;
set work._ds;
if not missing(chg) and base not in (., 0) then pchg = 100 * chg / base;
run;
/*==== 70-other ====*/
/* PARAMTYP (Parameter Type): Set to "DERIVED" -- to write. */
/* DTYPE: at each analysis visit after baseline (2, 4, 6, 8, 8.1, 9.1, 10.1, 11.1, 12, 16, 20, 24, 26, 103.5, 106, 301) without a value, the last value before it (DTYPE = LOCF),
per subject and PARAMCD: the record carried forward, at the visit it fills. */
/* Each window's record: the one nearest its target day (the one analyzed), the earlier on a tie. */
proc sort data=work._ds(where=(avisitn in (2, 4, 6, 8, 8.1, 9.1, 10.1, 11.1, 12, 16, 20, 24, 26, 103.5, 106, 301) and not missing(aval))) out=work._obs;
by usubjid paramcd avisitn awtdiff ady;
run;
data work._obs; set work._obs; by usubjid paramcd avisitn; if first.avisitn; run;
data work._grid;
set work._obs(keep=usubjid paramcd);
by usubjid paramcd;
if first.paramcd;
do avisitn = 2, 4, 6, 8, 8.1, 9.1, 10.1, 11.1, 12, 16, 20, 24, 26, 103.5, 106, 301; output; end;
run;
data work._missing;
merge work._grid(in=_want) work._obs(in=_have keep=usubjid paramcd avisitn);
by usubjid paramcd avisitn;
if _want and not _have;
run;
proc sql;
create table work._locf as
select o.*, m.avisitn as _to
from work._missing as m, work._obs as o
where o.usubjid = m.usubjid and o.paramcd = m.paramcd and o.avisitn < m.avisitn
order by o.usubjid, o.paramcd, _to, o.avisitn;
quit;
data work._locf;
set work._locf;
by usubjid paramcd _to;
if last._to;
avisitn = _to;
length dtype $8;
dtype = 'LOCF';
drop _to;
run;
/* The visit's name and window, as the observed records have it. */
proc sort data=work._obs(keep=avisitn avisit awtarget awlo awhi awrange) out=work._avisit nodupkey; by avisitn; run;
proc sort data=work._locf; by avisitn; run;
data work._locf;
merge work._locf(in=_in drop=avisit awtarget awlo awhi awrange) work._avisit;
by avisitn;
if _in;
awtdiff = abs(ady - awtarget);
run;
data work._ds; set work._ds work._locf; run;
/* ANL01FL: in each window of USUBJID, PARAMCD and AVISITN, the record nearest the target day (the earlier on a tie). */
proc sort data=work._ds;
by usubjid paramcd avisitn awtdiff ady;
run;
data work._ds;
set work._ds;
by usubjid paramcd avisitn;
length anl01fl $1;
if not missing(avisitn) and first.avisitn then anl01fl = 'Y';
else anl01fl = '';
run;
/*==== 89-final ====*/
/* The data set as derived; the finalize step keeps the specification's variables. */
data work._final;
set work._ds;
run;
/*==== 90-finalize ====*/
/* 90-finalize: from the specification; the variables, their order and attributes are not changed here. */
/* The text variables the specification gives no length: as long as their longest value (at least 1). */
%let _len1 = 1; %let _len2 = 1; %let _len3 = 1; %let _len4 = 1; %let _len5 = 1; %let _len6 = 1; %let _len7 = 1; %let _len8 = 1; %let _len9 = 1; %let _len10 = 1; %let _len11 = 1; %let _len12 = 1; %let _len13 = 1; %let _len14 = 1; %let _len15 = 1; %let _len16 = 1; %let _len17 = 1; %let _len18 = 1; %let _len19 = 1; %let _len20 = 1; %let _len21 = 1;
data _null_;
length _ren _asg _siz $32767;
_dsid = open('work._final');
if varnum(_dsid, 'STUDYID') > 0 then do; _ren = catx(' ', _ren, 'STUDYID=_rz1'); _asg = catx(' ', _asg, 'STUDYID = _rz1;');
_siz = catx(' ', _siz, '_len1 = max(_len1, lengthn(STUDYID));'); end;
if varnum(_dsid, 'SITEID') > 0 then do; _ren = catx(' ', _ren, 'SITEID=_rz2'); _asg = catx(' ', _asg, 'SITEID = _rz2;');
_siz = catx(' ', _siz, '_len2 = max(_len2, lengthn(SITEID));'); end;
if varnum(_dsid, 'SITEGR1') > 0 then do; _ren = catx(' ', _ren, 'SITEGR1=_rz3'); _asg = catx(' ', _asg, 'SITEGR1 = _rz3;');
_siz = catx(' ', _siz, '_len3 = max(_len3, lengthn(SITEGR1));'); end;
if varnum(_dsid, 'USUBJID') > 0 then do; _ren = catx(' ', _ren, 'USUBJID=_rz4'); _asg = catx(' ', _asg, 'USUBJID = _rz4;');
_siz = catx(' ', _siz, '_len4 = max(_len4, lengthn(USUBJID));'); end;
if varnum(_dsid, 'TRTP') > 0 then do; _ren = catx(' ', _ren, 'TRTP=_rz5'); _asg = catx(' ', _asg, 'TRTP = _rz5;');
_siz = catx(' ', _siz, '_len5 = max(_len5, lengthn(TRTP));'); end;
if varnum(_dsid, 'AGEGR1') > 0 then do; _ren = catx(' ', _ren, 'AGEGR1=_rz6'); _asg = catx(' ', _asg, 'AGEGR1 = _rz6;');
_siz = catx(' ', _siz, '_len6 = max(_len6, lengthn(AGEGR1));'); end;
if varnum(_dsid, 'RACE') > 0 then do; _ren = catx(' ', _ren, 'RACE=_rz7'); _asg = catx(' ', _asg, 'RACE = _rz7;');
_siz = catx(' ', _siz, '_len7 = max(_len7, lengthn(RACE));'); end;
if varnum(_dsid, 'SEX') > 0 then do; _ren = catx(' ', _ren, 'SEX=_rz8'); _asg = catx(' ', _asg, 'SEX = _rz8;');
_siz = catx(' ', _siz, '_len8 = max(_len8, lengthn(SEX));'); end;
if varnum(_dsid, 'ITTFL') > 0 then do; _ren = catx(' ', _ren, 'ITTFL=_rz9'); _asg = catx(' ', _asg, 'ITTFL = _rz9;');
_siz = catx(' ', _siz, '_len9 = max(_len9, lengthn(ITTFL));'); end;
if varnum(_dsid, 'EFFFL') > 0 then do; _ren = catx(' ', _ren, 'EFFFL=_rz10'); _asg = catx(' ', _asg, 'EFFFL = _rz10;');
_siz = catx(' ', _siz, '_len10 = max(_len10, lengthn(EFFFL));'); end;
if varnum(_dsid, 'COMP24FL') > 0 then do; _ren = catx(' ', _ren, 'COMP24FL=_rz11'); _asg = catx(' ', _asg, 'COMP24FL = _rz11;');
_siz = catx(' ', _siz, '_len11 = max(_len11, lengthn(COMP24FL));'); end;
if varnum(_dsid, 'AVISIT') > 0 then do; _ren = catx(' ', _ren, 'AVISIT=_rz12'); _asg = catx(' ', _asg, 'AVISIT = _rz12;');
_siz = catx(' ', _siz, '_len12 = max(_len12, lengthn(AVISIT));'); end;
if varnum(_dsid, 'VISIT') > 0 then do; _ren = catx(' ', _ren, 'VISIT=_rz13'); _asg = catx(' ', _asg, 'VISIT = _rz13;');
_siz = catx(' ', _siz, '_len13 = max(_len13, lengthn(VISIT));'); end;
if varnum(_dsid, 'PARAM') > 0 then do; _ren = catx(' ', _ren, 'PARAM=_rz14'); _asg = catx(' ', _asg, 'PARAM = _rz14;');
_siz = catx(' ', _siz, '_len14 = max(_len14, lengthn(PARAM));'); end;
if varnum(_dsid, 'PARAMCD') > 0 then do; _ren = catx(' ', _ren, 'PARAMCD=_rz15'); _asg = catx(' ', _asg, 'PARAMCD = _rz15;');
_siz = catx(' ', _siz, '_len15 = max(_len15, lengthn(PARAMCD));'); end;
if varnum(_dsid, 'PARAMTYP') > 0 then do; _ren = catx(' ', _ren, 'PARAMTYP=_rz16'); _asg = catx(' ', _asg, 'PARAMTYP = _rz16;');
_siz = catx(' ', _siz, '_len16 = max(_len16, lengthn(PARAMTYP));'); end;
if varnum(_dsid, 'ABLFL') > 0 then do; _ren = catx(' ', _ren, 'ABLFL=_rz17'); _asg = catx(' ', _asg, 'ABLFL = _rz17;');
_siz = catx(' ', _siz, '_len17 = max(_len17, lengthn(ABLFL));'); end;
if varnum(_dsid, 'ANL01FL') > 0 then do; _ren = catx(' ', _ren, 'ANL01FL=_rz18'); _asg = catx(' ', _asg, 'ANL01FL = _rz18;');
_siz = catx(' ', _siz, '_len18 = max(_len18, lengthn(ANL01FL));'); end;
if varnum(_dsid, 'DTYPE') > 0 then do; _ren = catx(' ', _ren, 'DTYPE=_rz19'); _asg = catx(' ', _asg, 'DTYPE = _rz19;');
_siz = catx(' ', _siz, '_len19 = max(_len19, lengthn(DTYPE));'); end;
if varnum(_dsid, 'AWRANGE') > 0 then do; _ren = catx(' ', _ren, 'AWRANGE=_rz20'); _asg = catx(' ', _asg, 'AWRANGE = _rz20;');
_siz = catx(' ', _siz, '_len20 = max(_len20, lengthn(AWRANGE));'); end;
if varnum(_dsid, 'AWU') > 0 then do; _ren = catx(' ', _ren, 'AWU=_rz21'); _asg = catx(' ', _asg, 'AWU = _rz21;');
_siz = catx(' ', _siz, '_len21 = max(_len21, lengthn(AWU));'); end;
_rc = close(_dsid);
if _ren ne '' then _ren = cats('(rename=(', _ren, '))');
call symputx('_ren', _ren);
call symputx('_asg', _asg);
call symputx('_siz', _siz);
run;
data _null_;
set work._final end=_end;
retain _len1 1 _len2 1 _len3 1 _len4 1 _len5 1 _len6 1 _len7 1 _len8 1 _len9 1 _len10 1 _len11 1 _len12 1 _len13 1 _len14 1 _len15 1 _len16 1 _len17 1 _len18 1 _len19 1 _len20 1 _len21 1;
&_siz
if _end then do;
call symputx('_len1', _len1);
call symputx('_len2', _len2);
call symputx('_len3', _len3);
call symputx('_len4', _len4);
call symputx('_len5', _len5);
call symputx('_len6', _len6);
call symputx('_len7', _len7);
call symputx('_len8', _len8);
call symputx('_len9', _len9);
call symputx('_len10', _len10);
call symputx('_len11', _len11);
call symputx('_len12', _len12);
call symputx('_len13', _len13);
call symputx('_len14', _len14);
call symputx('_len15', _len15);
call symputx('_len16', _len16);
call symputx('_len17', _len17);
call symputx('_len18', _len18);
call symputx('_len19', _len19);
call symputx('_len20', _len20);
call symputx('_len21', _len21);
end;
run;
data adam.adnpix(label="NPI-X Item Analysis Data");
attrib
STUDYID length=$&_len1 label="Study Identifier"
SITEID length=$&_len2 label="Study Site Identifier"
SITEGR1 length=$&_len3 label="Pooled Site Group 1"
USUBJID length=$&_len4 label="Unique Subject Identifier"
TRTSDT length=8 label="Date of First Exposure to Treatment" format=DATE9.
TRTEDT length=8 label="Date of Last Exposure to Treatment" format=DATE9.
TRTP length=$&_len5 label="Planned Treatment"
TRTPN length=8 label="Planned Treatment (N)"
AGE length=8 label="Age"
AGEGR1 length=$&_len6 label="Pooled Age Group 1"
AGEGR1N length=8 label="Pooled Age Group 1 (N)"
RACE length=$&_len7 label="Race"
RACEN length=8 label="Race (N)"
SEX length=$&_len8 label="Sex"
ITTFL length=$&_len9 label="Intent-to-Treat Population Flag"
EFFFL length=$&_len10 label="Efficacy Population Flag"
COMP24FL length=$&_len11 label="Completers of Week 24 Population Flag"
AVISIT length=$&_len12 label="Analysis Visit"
AVISITN length=8 label="Analysis Visit (N)"
ADY length=8 label="Analysis Relative Day"
ADT length=8 label="Analysis Date" format=DATE9.
VISITNUM length=8 label="Visit Number"
VISIT length=$&_len13 label="Visit Name"
PARAM length=$&_len14 label="Parameter"
PARAMCD length=$&_len15 label="Parameter Code"
PARAMN length=8 label="Parameter (N)"
PARAMTYP length=$&_len16 label="Parameter Type"
AVAL length=8 label="Analysis Value"
BASE length=8 label="Baseline Value"
CHG length=8 label="Change from Baseline"
PCHG length=8 label="Percent Change from Baseline"
ABLFL length=$&_len17 label="Baseline Record Flag"
ANL01FL length=$&_len18 label="Analysis Flag 01"
DTYPE length=$&_len19 label="Derivation Type"
AWRANGE length=$&_len20 label="Analysis Window Valid Relative Range"
AWTARGET length=8 label="Analysis Window Target"
AWTDIFF length=8 label="Analysis Window Diff from Target"
AWLO length=8 label="Analysis Window Beginning Timepoint"
AWHI length=8 label="Analysis Window Ending Timepoint"
AWU length=$&_len21 label="Analysis Window Unit"
QSSEQ length=8 label="Sequence Number"
;
set work._final&_ren;
&_asg
if not missing(VISITNUM) then VISITNUM = round(VISITNUM, 1e-1);
keep STUDYID SITEID SITEGR1 USUBJID TRTSDT TRTEDT TRTP TRTPN AGE AGEGR1 AGEGR1N RACE RACEN SEX ITTFL EFFFL COMP24FL AVISIT AVISITN ADY ADT VISITNUM VISIT PARAM PARAMCD PARAMN PARAMTYP AVAL BASE CHG PCHG ABLFL ANL01FL DTYPE AWRANGE AWTARGET AWTDIFF AWLO AWHI AWU QSSEQ;
run;
proc sort data=adam.adnpix; by USUBJID PARAMCD AVISIT ADT QSSEQ; run;
Data (first 20 of 61,939 records, uploaded)
| STUDYID | SITEID | SITEGR1 | USUBJID | TRTSDT | TRTEDT | TRTP | TRTPN | AGE | AGEGR1 | AGEGR1N | RACE | RACEN | SEX | ITTFL | EFFFL | COMP24FL | AVISIT | AVISITN | ADY | ADT | VISITNUM | VISIT | PARAM | PARAMCD | PARAMN | PARAMTYP | AVAL | BASE | CHG | PCHG | ABLFL | ANL01FL | DTYPE | AWRANGE | AWTARGET | AWTDIFF | AWLO | AWHI | AWU | QSSEQ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CDISCPILOT01 | 701 | 701 | 01-701-1015 | 2014-01-02 | 2014-07-02 | Placebo | 0 | 63 | <65 | 1 | WHITE | 1 | F | Y | Y | Y | 8.1 | 63 | 2014-03-05 | 8 | WEEK 8 | NPI-X Item A (Delusion) Score | NPITM01S | 1 | 0 | 0 | 0 | Y | LOCF | DAYS | 3102 | |||||||||
| CDISCPILOT01 | 701 | 701 | 01-701-1015 | 2014-01-02 | 2014-07-02 | Placebo | 0 | 63 | <65 | 1 | WHITE | 1 | F | Y | Y | Y | 9.1 | 63 | 2014-03-05 | 8 | WEEK 8 | NPI-X Item A (Delusion) Score | NPITM01S | 1 | 0 | 0 | 0 | Y | LOCF | DAYS | 3102 | |||||||||
| CDISCPILOT01 | 701 | 701 | 01-701-1015 | 2014-01-02 | 2014-07-02 | Placebo | 0 | 63 | <65 | 1 | WHITE | 1 | F | Y | Y | Y | 10.1 | 63 | 2014-03-05 | 8 | WEEK 8 | NPI-X Item A (Delusion) Score | NPITM01S | 1 | 0 | 0 | 0 | Y | LOCF | DAYS | 3102 | |||||||||
| CDISCPILOT01 | 701 | 701 | 01-701-1015 | 2014-01-02 | 2014-07-02 | Placebo | 0 | 63 | <65 | 1 | WHITE | 1 | F | Y | Y | Y | 11.1 | 63 | 2014-03-05 | 8 | WEEK 8 | NPI-X Item A (Delusion) Score | NPITM01S | 1 | 0 | 0 | 0 | Y | LOCF | DAYS | 3102 | |||||||||
| CDISCPILOT01 | 701 | 701 | 01-701-1015 | 2014-01-02 | 2014-07-02 | Placebo | 0 | 63 | <65 | 1 | WHITE | 1 | F | Y | Y | Y | 103.5 | 182 | 2014-07-02 | 13 | WEEK 26 | NPI-X Item A (Delusion) Score | NPITM01S | 1 | 0 | 0 | 0 | Y | LOCF | DAYS | 3277 | |||||||||
| CDISCPILOT01 | 701 | 701 | 01-701-1015 | 2014-01-02 | 2014-07-02 | Placebo | 0 | 63 | <65 | 1 | WHITE | 1 | F | Y | Y | Y | 106 | 182 | 2014-07-02 | 13 | WEEK 26 | NPI-X Item A (Delusion) Score | NPITM01S | 1 | 0 | 0 | 0 | Y | LOCF | DAYS | 3277 | |||||||||
| CDISCPILOT01 | 701 | 701 | 01-701-1015 | 2014-01-02 | 2014-07-02 | Placebo | 0 | 63 | <65 | 1 | WHITE | 1 | F | Y | Y | Y | 301 | 182 | 2014-07-02 | 13 | WEEK 26 | NPI-X Item A (Delusion) Score | NPITM01S | 1 | 0 | 0 | 0 | Y | LOCF | DAYS | 3277 | |||||||||
| CDISCPILOT01 | 701 | 701 | 01-701-1015 | 2014-01-02 | 2014-07-02 | Placebo | 0 | 63 | <65 | 1 | WHITE | 1 | F | Y | Y | Y | Baseline | 0 | 1 | 2014-01-02 | 3 | BASELINE | NPI-X Item A (Delusion) Score | NPITM01S | 1 | 0 | 0 | Y | Y | <=1 | 1 | 0 | 1 | DAYS | 3002 | |||||
| CDISCPILOT01 | 701 | 701 | 01-701-1015 | 2014-01-02 | 2014-07-02 | Placebo | 0 | 63 | <65 | 1 | WHITE | 1 | F | Y | Y | Y | Week 12 | 12 | 84 | 2014-03-26 | 9 | WEEK 12 | NPI-X Item A (Delusion) Score | NPITM01S | 1 | 0 | 0 | 0 | Y | 71-98 | 84 | 0 | 71 | 98 | DAYS | 3127 | ||||
| CDISCPILOT01 | 701 | 701 | 01-701-1015 | 2014-01-02 | 2014-07-02 | Placebo | 0 | 63 | <65 | 1 | WHITE | 1 | F | Y | Y | Y | Week 12 | 12 | 98 | 2014-04-09 | 9.1 | WEEK 14 (T) | NPI-X Item A (Delusion) Score | NPITM01S | 1 | 0 | 0 | 0 | 71-98 | 84 | 14 | 71 | 98 | DAYS | 3152 | |||||
| CDISCPILOT01 | 701 | 701 | 01-701-1015 | 2014-01-02 | 2014-07-02 | Placebo | 0 | 63 | <65 | 1 | WHITE | 1 | F | Y | Y | Y | Week 16 | 16 | 126 | 2014-05-07 | 10 | WEEK 16 | NPI-X Item A (Delusion) Score | NPITM01S | 1 | 0 | 0 | 0 | Y | 99-126 | 112 | 14 | 99 | 126 | DAYS | 3177 | ||||
| CDISCPILOT01 | 701 | 701 | 01-701-1015 | 2014-01-02 | 2014-07-02 | Placebo | 0 | 63 | <65 | 1 | WHITE | 1 | F | Y | Y | Y | Week 2 | 2 | 15 | 2014-01-16 | 4 | WEEK 2 | NPI-X Item A (Delusion) Score | NPITM01S | 1 | 0 | 0 | 0 | Y | 2-21 | 14 | 1 | 2 | 21 | DAYS | 3027 | ||||
| CDISCPILOT01 | 701 | 701 | 01-701-1015 | 2014-01-02 | 2014-07-02 | Placebo | 0 | 63 | <65 | 1 | WHITE | 1 | F | Y | Y | Y | Week 20 | 20 | 140 | 2014-05-21 | 11 | WEEK 20 | NPI-X Item A (Delusion) Score | NPITM01S | 1 | 0 | 0 | 0 | Y | 127-154 | 140 | 0 | 127 | 154 | DAYS | 3202 | ||||
| CDISCPILOT01 | 701 | 701 | 01-701-1015 | 2014-01-02 | 2014-07-02 | Placebo | 0 | 63 | <65 | 1 | WHITE | 1 | F | Y | Y | Y | Week 20 | 20 | 154 | 2014-06-04 | 11.1 | WEEK 22 (T) | NPI-X Item A (Delusion) Score | NPITM01S | 1 | 0 | 0 | 0 | 127-154 | 140 | 14 | 127 | 154 | DAYS | 3227 | |||||
| CDISCPILOT01 | 701 | 701 | 01-701-1015 | 2014-01-02 | 2014-07-02 | Placebo | 0 | 63 | <65 | 1 | WHITE | 1 | F | Y | Y | Y | Week 24 | 24 | 168 | 2014-06-18 | 12 | WEEK 24 | NPI-X Item A (Delusion) Score | NPITM01S | 1 | 0 | 0 | 0 | Y | 155-175 | 168 | 0 | 155 | 175 | DAYS | 3252 | ||||
| CDISCPILOT01 | 701 | 701 | 01-701-1015 | 2014-01-02 | 2014-07-02 | Placebo | 0 | 63 | <65 | 1 | WHITE | 1 | F | Y | Y | Y | Week 26 | 26 | 182 | 2014-07-02 | 13 | WEEK 26 | NPI-X Item A (Delusion) Score | NPITM01S | 1 | 0 | 0 | 0 | Y | >175 | 182 | 0 | 176 | DAYS | 3277 | |||||
| CDISCPILOT01 | 701 | 701 | 01-701-1015 | 2014-01-02 | 2014-07-02 | Placebo | 0 | 63 | <65 | 1 | WHITE | 1 | F | Y | Y | Y | Week 4 | 4 | 29 | 2014-01-30 | 5 | WEEK 4 | NPI-X Item A (Delusion) Score | NPITM01S | 1 | 0 | 0 | 0 | Y | 22-35 | 28 | 1 | 22 | 35 | DAYS | 3052 | ||||
| CDISCPILOT01 | 701 | 701 | 01-701-1015 | 2014-01-02 | 2014-07-02 | Placebo | 0 | 63 | <65 | 1 | WHITE | 1 | F | Y | Y | Y | Week 6 | 6 | 42 | 2014-02-12 | 7 | WEEK 6 | NPI-X Item A (Delusion) Score | NPITM01S | 1 | 0 | 0 | 0 | Y | 36-49 | 42 | 0 | 36 | 49 | DAYS | 3077 | ||||
| CDISCPILOT01 | 701 | 701 | 01-701-1015 | 2014-01-02 | 2014-07-02 | Placebo | 0 | 63 | <65 | 1 | WHITE | 1 | F | Y | Y | Y | Week 8 | 8 | 63 | 2014-03-05 | 8 | WEEK 8 | NPI-X Item A (Delusion) Score | NPITM01S | 1 | 0 | 0 | 0 | Y | 50-70 | 56 | 7 | 50 | 70 | DAYS | 3102 | ||||
| CDISCPILOT01 | 701 | 701 | 01-701-1015 | 2014-01-02 | 2014-07-02 | Placebo | 0 | 63 | <65 | 1 | WHITE | 1 | F | Y | Y | Y | 8.1 | 63 | 2014-03-05 | 8 | WEEK 8 | NPI-X Item B (Hallucination) Score | NPITM02S | 2 | 0 | 0 | 0 | Y | LOCF | DAYS | 3104 |