Baseline Value

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

Baseline Value

Hi All,

In My Project Baseline Value is defined as follows:

Baseline Value 'B' is Last Non-missing measurement before first study drug dose scheduled & unscheduled.

What it means?

Could Any one explain this.

Thanks,

Khan.


Accepted Solutions
Solution
‎05-08-2013 01:19 PM
Super Contributor
Posts: 543

Re: Baseline Value

Hi, Shazia.

How about this?

data want;

   if endlead not = 1 then do;

        set your_data (firstobs = 2) end = endlead;

            next_vsvalue = vsvalue;

   end;

   set in;

   by subject;

        if last.subject then do;

            next_vsvalue = .;

        end;

    if next_vsvalue = . & vsvalue ne . then baseline_flag = "B";

run;

proc freq data = want;

    tables bslflg * baseline_flag;

run;

Good luck!

View solution in original post


All Replies
Super Contributor
Posts: 543

Re: Baseline Value

You probably have a manual of operation, or some data dictionary, or something that should describe your data (better).

But, say you have a data like this:

ID Measurement Drug_Dose

1     4                   0

1     .                    0

1     3                    .

1     2                    12

1     .                    12

I would think your baseline value would be record in red?

The last measurement (non-missing) before first drug-dose...

PS: please use this information with lots of grains of salt :smileyplain: (cautiously)

Occasional Contributor
Posts: 5

Re: Baseline Value

Posted in reply to AncaTilea

Hi,

Here I have given the data below, how our data looks, And I want to Flag the Baseline Value 'B' is Last Non-missing measurement before first study drug dose scheduled & unscheduled.

SubjectVisitReportVisitDtTrtStDtNAME OF FORMERVSVALUEVSCODE
VARIABLE
101Baseline06JUL10:00:00:0012JUL10:08:00:00Height1001
101Cycle1Day112JUL10:00:00:0012JUL10:08:00:00Height1051
101Cycle1Day9.19JUL10:00:00:00Height.1
101Cycle2Day1212AUG10:00:00:0012JUL10:08:00:00Height1551
101Cycle2Day230JUL10:00:00:0012JUL10:08:00:00Height1551
101EndOfTreatment14OCT10:00:00:0012JUL10:08:00:00Height1551
101Baseline06JUL10:00:00:0012JUL10:08:00:00Weight502
101Cycle1Day112JUL10:00:00:0012JUL10:08:00:00Weight452
101Cycle1Day9.19JUL10:00:00:00Weight.2
101Cycle2Day1212AUG10:00:00:0012JUL10:08:00:00Weight652
101Cycle2Day230JUL10:00:00:0012JUL10:08:00:00Weight652
101EndOfTreatment14OCT10:00:00:0012JUL10:08:00:00Weight652
101Baseline06JUL10:00:00:0012JUL10:08:00:00BodyTemp383
101Cycle1Day112JUL10:00:00:0012JUL10:08:00:00BodyTemp353
101Cycle1Day9.19JUL10:00:00:00BodyTemp.3
101Cycle2Day1212AUG10:00:00:0012JUL10:08:00:00BodyTemp443
101Cycle2Day230JUL10:00:00:0012JUL10:08:00:00BodyTemp443
101EndOfTreatment14OCT10:00:00:0012JUL10:08:00:00BodyTemp443
102Baseline06AUG10:00:00:0012AUG10:08:00:00Height1001
102Cycle1Day112AUG10:00:00:0012AUG10:08:00:00Height1251
102Cycle1Day9.19AUG10:00:00:00Height.1
102Cycle2Day1212SEP10:00:00:0012AUG10:08:00:00Height1551
102Cycle2Day230AUG10:00:00:0012AUG10:08:00:00Height1451
102EndOfTreatment07AUG10:00:00:0012AUG10:08:00:00Height1651
102Baseline06AUG10:00:00:0012AUG10:08:00:00Weight502
102Cycle1Day112AUG10:00:00:0012AUG10:08:00:00Weight452
102Cycle1Day9.19AUG10:00:00:00Weight.2
102Cycle2Day1212SEP10:00:00:0012AUG10:08:00:00Weight652
102Cycle2Day230AUG10:00:00:0012AUG10:08:00:00Weight752
102EndOfTreatment07AUG10:00:00:0012AUG10:08:00:00Weight652
102Baseline06AUG10:00:00:0012AUG10:08:00:00BodyTemp483
102Cycle1Day112AUG10:00:00:0012AUG10:08:00:00BodyTemp353
102Cycle1Day9.19AUG10:00:00:00BodyTemp.3
102Cycle2Day1212SEP10:00:00:0012AUG10:08:00:00BodyTemp443
102Cycle2Day230AUG10:00:00:0012AUG10:08:00:00BodyTemp443
102EndOfTreatment07AUG10:00:00:0012AUG10:08:00:00BodyTemp443
103Baseline06JUN10:00:00:0012JUN10:08:00:00Height501
103Cycle1day112JUN10:00:00:0012JUN10:08:00:00Height.1
103Cycle1day925JUN10:00:00:0012JUN10:08:00:00Height.1
103Cycle2day105JUL10:00:00:0012JUN10:08:00:00Height.1
103EndofTreatment25SEP10:00:00:0012JUN10:08:00:00Height.1
103Baseline06JUN10:00:00:0012JUN10:08:00:00Weight452
103Cycle1day112JUN10:00:00:0012JUN10:08:00:00Weight452
103Cycle1day925JUN10:00:00:0012JUN10:08:00:00Weight752
103Cycle2day105JUL10:00:00:0012JUN10:08:00:00Weight752
103EndofTreatment25SEP10:00:00:0012JUN10:08:00:00Weight752
103Baseline06JUN10:00:00:0012JUN10:08:00:00BodyTemp653
103Cycle1day112JUN10:00:00:0012JUN10:08:00:00BodyTemp653
103Cycle1day925JUN10:00:00:0012JUN10:08:00:00BodyTemp653
103Cycle2day105JUL10:00:00:0012JUN10:08:00:00BodyTemp653
103EndofTreatment25SEP10:00:00:0012JUN10:08:00:00BodyTemp653

Thanks,

Khan.

Super Contributor
Posts: 543

Re: Baseline Value

Ok, in the sample data you sent, can you add another column and describe which row should get the baseline "B" value.

So, I can figure out how to code it.

Thanks.

Occasional Contributor
Posts: 5

Re: Baseline Value

Posted in reply to AncaTilea

Hi Anca,

Please see the sample with Baseline flags (BSLFLG), I want this as Output,

Please guide me how it will be.

SubjectVisitReportVisitDtTrtStDtNAME OF FORMERVSVALUEVSCODEBSLFLG
VARIABLE
101Baseline06JUL10:00:00:0012JUL10:08:00:00Height1001
101Cycle1Day112JUL10:00:00:0012JUL10:08:00:00Height1051B
101Cycle1Day919JUL10:00:00:0012JUL10:08:00:00Height.1
101Cycle2Day1212AUG10:00:00:0012JUL10:08:00:00Height1551
101Cycle2Day230JUL10:00:00:0012JUL10:08:00:00Height1551
101EndOfTreatment14OCT10:00:00:0012JUL10:08:00:00Height1551
101Baseline06JUL10:00:00:0012JUL10:08:00:00Weight502
101Cycle1Day112JUL10:00:00:0012JUL10:08:00:00Weight452B
101Cycle1Day919JUL10:00:00:0012JUL10:08:00:00Weight.2
101Cycle2Day1212AUG10:00:00:0012JUL10:08:00:00Weight652
101Cycle2Day230JUL10:00:00:0012JUL10:08:00:00Weight652
101EndOfTreatment14OCT10:00:00:0012JUL10:08:00:00Weight652
101Baseline06JUL10:00:00:0012JUL10:08:00:00BodyTemp383
101Cycle1Day112JUL10:00:00:0012JUL10:08:00:00BodyTemp353B
101Cycle1Day919JUL10:00:00:0012JUL10:08:00:00BodyTemp.3
101Cycle2Day1212AUG10:00:00:0012JUL10:08:00:00BodyTemp443
101Cycle2Day230JUL10:00:00:0012JUL10:08:00:00BodyTemp443
101EndOfTreatment14OCT10:00:00:0012JUL10:08:00:00BodyTemp443
102Baseline06AUG10:00:00:0012AUG10:08:00:00Height1001
102Cycle1Day112AUG10:00:00:0012AUG10:08:00:00Height1251B
102Cycle1Day919AUG10:00:00:0012AUG10:08:00:00Height.1
102Cycle2Day1212SEP10:00:00:0012AUG10:08:00:00Height1551
102Cycle2Day230AUG10:00:00:0012AUG10:08:00:00Height1451
102EndOfTreatment07AUG10:00:00:0012AUG10:08:00:00Height1651
102Baseline06AUG10:00:00:0012AUG10:08:00:00Weight502
102Cycle1Day112AUG10:00:00:0012AUG10:08:00:00Weight452B
102Cycle1Day919AUG10:00:00:0012AUG10:08:00:00Weight.2
102Cycle2Day1212SEP10:00:00:0012AUG10:08:00:00Weight652
102Cycle2Day230AUG10:00:00:0012AUG10:08:00:00Weight752
102EndOfTreatment07AUG10:00:00:0012AUG10:08:00:00Weight652
102Baseline06AUG10:00:00:0012AUG10:08:00:00BodyTemp483
102Cycle1Day112AUG10:00:00:0012AUG10:08:00:00BodyTemp353B
102Cycle1Day919AUG10:00:00:0012AUG10:08:00:00BodyTemp.3
102Cycle2Day1212SEP10:00:00:0012AUG10:08:00:00BodyTemp443
102Cycle2Day230AUG10:00:00:0012AUG10:08:00:00BodyTemp443
102EndOfTreatment07AUG10:00:00:0012AUG10:08:00:00BodyTemp443
103Baseline06JUN10:00:00:0012JUN10:08:00:00Height501B
103Cycle1day112JUN10:00:00:0012JUN10:08:00:00Height.1
103Cycle1day925JUN10:00:00:0012JUN10:08:00:00Height.1
103Cycle2day105JUL10:00:00:0012JUN10:08:00:00Height.1
103EndofTreatment25SEP10:00:00:0012JUN10:08:00:00Height.1
103Baseline06JUN10:00:00:0012JUN10:08:00:00Weight452
103Cycle1day112JUN10:00:00:0012JUN10:08:00:00Weight452B
103Cycle1day925JUN10:00:00:0012JUN10:08:00:00Weight.2
103Cycle2day105JUL10:00:00:0012JUN10:08:00:00Weight752
103EndofTreatment25SEP10:00:00:0012JUN10:08:00:00Weight752
103Baseline06JUN10:00:00:0012JUN10:08:00:00BodyTemp653
103Cycle1day112JUN10:00:00:0012JUN10:08:00:00BodyTemp653B
103Cycle1day925JUN10:00:00:0012JUN10:08:00:00BodyTemp.3
103Cycle2day105JUL10:00:00:0012JUN10:08:00:00BodyTemp653
103EndofTreatment25SEP10:00:00:0012JUN10:08:00:00BodyTemp653

Thanks,

Shazia

Solution
‎05-08-2013 01:19 PM
Super Contributor
Posts: 543

Re: Baseline Value

Hi, Shazia.

How about this?

data want;

   if endlead not = 1 then do;

        set your_data (firstobs = 2) end = endlead;

            next_vsvalue = vsvalue;

   end;

   set in;

   by subject;

        if last.subject then do;

            next_vsvalue = .;

        end;

    if next_vsvalue = . & vsvalue ne . then baseline_flag = "B";

run;

proc freq data = want;

    tables bslflg * baseline_flag;

run;

Good luck!

Occasional Contributor
Posts: 5

Re: Baseline Value

Posted in reply to AncaTilea

Hi Anca,

I tried the above code but it is giving Baseline Flag to "EndofTreatment" also that should exclude.

The output file after executing the above code..

SubjectVisitReportVisitDtTrtStDtNAME OF FORMERVSVALUEVSCODEnext_vsvaluebaseline_flag
VARIABLE
101Baseline06JUL10:00:00:0012JUL10:08:00:00Height1001105
101Cycle1Day112JUL10:00:00:0012JUL10:08:00:00Height1051.B
101Cycle1Day919JUL10:00:00:0012JUL10:08:00:00Height.1155
101Cycle2Day1212AUG10:00:00:0012JUL10:08:00:00Height1551155
101Cycle2Day230JUL10:00:00:0012JUL10:08:00:00Height1551155
101EndOfTreatment14OCT10:00:00:0012JUL10:08:00:00Height155150
101Baseline06JUL10:00:00:0012JUL10:08:00:00Weight50245
101Cycle1Day112JUL10:00:00:0012JUL10:08:00:00Weight452.B
101Cycle1Day919JUL10:00:00:0012JUL10:08:00:00Weight.265
101Cycle2Day1212AUG10:00:00:0012JUL10:08:00:00Weight65265
101Cycle2Day230JUL10:00:00:0012JUL10:08:00:00Weight65265
101EndOfTreatment14OCT10:00:00:0012JUL10:08:00:00Weight65238
101Baseline06JUL10:00:00:0012JUL10:08:00:00BodyTemp38335
101Cycle1Day112JUL10:00:00:0012JUL10:08:00:00BodyTemp353.B
101Cycle1Day919JUL10:00:00:0012JUL10:08:00:00BodyTemp.344
101Cycle2Day1212AUG10:00:00:0012JUL10:08:00:00BodyTemp44344
101Cycle2Day230JUL10:00:00:0012JUL10:08:00:00BodyTemp44344
101EndOfTreatment14OCT10:00:00:0012JUL10:08:00:00BodyTemp443.B
102Baseline06AUG10:00:00:0012AUG10:08:00:00Height1001125
102Cycle1Day112AUG10:00:00:0012AUG10:08:00:00Height1251.B
102Cycle1Day919AUG10:00:00:0012AUG10:08:00:00Height.1155
102Cycle2Day1212SEP10:00:00:0012AUG10:08:00:00Height1551145
102Cycle2Day230AUG10:00:00:0012AUG10:08:00:00Height1451165
102EndOfTreatment07AUG10:00:00:0012AUG10:08:00:00Height165150
102Baseline06AUG10:00:00:0012AUG10:08:00:00Weight50245
102Cycle1Day112AUG10:00:00:0012AUG10:08:00:00Weight452.B
102Cycle1Day919AUG10:00:00:0012AUG10:08:00:00Weight.265
102Cycle2Day1212SEP10:00:00:0012AUG10:08:00:00Weight65275
102Cycle2Day230AUG10:00:00:0012AUG10:08:00:00Weight75265
102EndOfTreatment07AUG10:00:00:0012AUG10:08:00:00Weight65248
102Baseline06AUG10:00:00:0012AUG10:08:00:00BodyTemp48335
102Cycle1Day112AUG10:00:00:0012AUG10:08:00:00BodyTemp353.B
102Cycle1Day919AUG10:00:00:0012AUG10:08:00:00BodyTemp.344
102Cycle2Day1212SEP10:00:00:0012AUG10:08:00:00BodyTemp44344
102Cycle2Day230AUG10:00:00:0012AUG10:08:00:00BodyTemp44344
102EndOfTreatment07AUG10:00:00:0012AUG10:08:00:00BodyTemp443.B
103Baseline06JUN10:00:00:0012JUN10:08:00:00Height501.B
103Cycle1day112JUN10:00:00:0012JUN10:08:00:00Height.1.
103Cycle1day925JUN10:00:00:0012JUN10:08:00:00Height.1.
103Cycle2day105JUL10:00:00:0012JUN10:08:00:00Height.1.
103EndofTreatment25SEP10:00:00:0012JUN10:08:00:00Height.145
103Baseline06JUN10:00:00:0012JUN10:08:00:00Weight45245
103Cycle1day112JUN10:00:00:0012JUN10:08:00:00Weight45275
103Cycle1day925JUN10:00:00:0012JUN10:08:00:00Weight75275
103Cycle2day105JUL10:00:00:0012JUN10:08:00:00Weight75275
103EndofTreatment25SEP10:00:00:0012JUN10:08:00:00Weight75265
103Baseline06JUN10:00:00:0012JUN10:08:00:00BodyTemp65365
103Cycle1day112JUN10:00:00:0012JUN10:08:00:00BodyTemp65365
103Cycle1day925JUN10:00:00:0012JUN10:08:00:00BodyTemp65365
103Cycle2day105JUL10:00:00:0012JUN10:08:00:00BodyTemp65365
103EndofTreatment25SEP10:00:00:0012JUN10:08:00:00BodyTemp653.
Super Contributor
Posts: 543

Re: Baseline Value

Sure.

Well, this may be bad coding, and not sure how many times do you need to do this, but you could just say

if VisitReport = "EndOfTreatment" then baseline_flag = "";

....

Occasional Contributor
Posts: 5

Re: Baseline Value

Hi Anca,

I included the below condition to exclude 'EndOfTreatment", Now I got exact Baseline Flags.....

Thanks You so much...for your help......................

  if next_vsvalue = . & vsvalue ne . & VISITReport NE 'EndOfTreatment' then baseline_flag = "B";

Thanks,

Khan.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 8 replies
  • 357 views
  • 0 likes
  • 2 in conversation