Helmut
★★★
avatar
Homepage
Vienna, Austria,
2012-01-06 02:47
(4855 d 21:56 ago)

Posting: # 7871
Views: 8,726
 

 SAS and missing values [Software]

Dear SAS-users,

as you might have guessed from this post I’m struggling with translating FDA’s RSABE code into PHX and R. For simplicity I hijacked EMA’s two Q&A data sets. What puzzles me is how SAS deals with empty cells (f.i. in the full replicate). We have 77 subjects and lat1t (77), lat2t (71), lat1r (76), lat2r (74). Is it correct that SAS throws a ‘.’ (line: lilat=0.5*(lat1t+lat2t-lat1r-lat2r);) in all but the 69 cases where we have complete data?

My results so far (Phoenix/WinNonlin 6.2.1.51 on logdata):

Data set I (full replicate TRTR|RTRT)

pointest   1.1546132
x          0.018259609
boundx     0.050907573
s2wr       0.20401347
y         -0.16253523
sWR        0.4516785
boundy    -0.12501551

Since sWR ≥ 0.294 apply scaled ABE:
a. -0.12501551 ≤ 0 &
b. 0.80 ≤ 1.1546 ≤ 1.25
Scaled Average BE shown (CVWR 47.57%)


Data set II (partial replicate TRR|RTR|RRT)

pointest   1.0226439
x         -0.00034955932
boundx     0.0052688215
s2wr       0.01298983
y         -0.010348851
sWR        0.11397294
boundy    -0.0066520374
critbound -0.0039728893

Since sWR < 0.294 apply unscaled ABE:
unscabe_pointest 1.0226
unscabe_lower    0.9705
unscabe_upper    1.0776

0.80 ≤ 0.9705 & 1.0776 ≤ 1.25
Average BE shown (CVintra 11.55%)


Dif-tor heh smusma 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Shuanghe
★★  

Spain,
2012-01-13 12:17
(4848 d 12:26 ago)

@ Helmut
Posting: # 7924
Views: 7,631
 

 SAS and missing values

Hi Helmut, Happy new year.

I also tested FDA's SABE approach using SAS 9.2 on EMA's datasets. Firstly, for your question. SAS does treat missing data as period symbol '.' by default.

With regards to the result, I have identical result (well, less decimals than yours :-D) for 3 periods dataset, but for full replicate data, I have same x, boundx and pointest values as yours but different values for other parameters. e.g.

S2wr      =  0.19931
Swr       =  0.44645
y         = -0.15879
boundy    = -0.12299
critbound = -0.092076


Those values were calculated based on Dlat and we should have 73 Dlat values. If I understood your post, you have 69? But 69 is the number of Ilat. Don't know if this is the reason we have different result.

Can anyone firstly check it using SAS, then using Phoenix or R?

Thanks.

All the best,
Shuanghe
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2012-01-13 14:31
(4848 d 10:12 ago)

@ Shuanghe
Posting: # 7925
Views: 7,675
 

 THX & another request

Dear Shuanghe!

❝ […] for full replicate data, I have same x, boundx and pointest values as yours but different values for other parameters […]


❝ Those values were calculated based on Dlat and we should have 73 Dlat values. If I understood your post, you have 69? But 69 is the number of Ilat. Don't know if this is the reason we have different result.


Thanks a lot! You guessed right – I filtered for complete data, but should have done differently for Ilat (n=69) and Dlat (n=73). Now I could reproduce your results in Phoenix:
s2wr       0.19931360
y         -0.15879089
sWR        0.44644551
boundy    -0.12298597
critbound -0.09207634

Since sWR ≥ 0.294 apply scaled ABE:
a. -0.09207634 ≤ 0 &
b. 0.80 ≤ 1.1546 ≤ 1.25
Scaled Average BE shown (CVWR 46.96%)

Would you be so kind and check my results for an incomplete partial replicate design as well? I removed period 3 (R) of subject 24 in data set II, and got:

pointest   1.0302521
x          0.00001265951
boundx     0.0065348721
s2wr       0.01032549
y         -0.00822620
sWR        0.10161441
boundy    -0.0052378774
critbound -0.0010393276

Since sWR < 0.294 apply unscaled ABE:
unscabe_pointest 1.0291
unscabe_lower    0.9775
unscabe_upper    1.0833

0.80 ≤ 0.9775 & 1.0833 ≤ 1.25
Average BE shown (CVWR 10.33%)


Thank you in advance!

Dif-tor heh smusma 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Shuanghe
★★  

Spain,
2012-01-13 17:14
(4848 d 07:29 ago)

@ Helmut
Posting: # 7930
Views: 7,525
 

 Congratulations for both of us :-D

Thanks for the confirmation! I also confirm that I reproduced your result without period 3 of subject 24 (again, with fewer decimals :cool:).
So congratulations for both of us.:-D

----
forgot to add data:

pointest:   1.03025
x:          0.00001266
boundx:     0.00653487
S2wr:       0.010325
theta:      0.79669
y:         -0.0082262
boundy:    -0.005237877
Swr:        0.10161
critbound: -0.001039327


Unscaled BE:
CL lower:  97.75
CL upper: 108.33
pointest: 102.91
ISCV:      10.3260%

All the best,
Shuanghe
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2012-01-13 17:39
(4848 d 07:03 ago)

@ Shuanghe
Posting: # 7931
Views: 7,608
 

 FDA's RSABE: Phoenix ‘validated’ against SAS

Dear Shuanghe,

great, thanks a lot – you made my day!

Dif-tor heh smusma 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Shuanghe
★★  

Spain,
2012-01-19 12:43
(4842 d 11:59 ago)

@ Helmut
Posting: # 7963
Views: 7,544
 

 How to obtain CINV value in Phoenix

Hi Helmut,

Inspired by your Phoenix validation of FDA's SABE, I spent some time on Phoenix as well, trying to make a template for my colleague.

Basically what I've done is data transformation and linear mixed effect in Phoenix workflow. I had identical result of pointest, x, boundx, S2wr, Swr and y as yours, but I was stuck in boundy, and consequently, critbound.

So my question is, how to calculate this "CINV" in Phoenix? :confused: I mean, I can get the value from SAS, or even from Excel, but that would mean I have to do it manually everytime.

Is there any easy way to do it? or I have to import a table of the inverse chi-square distribution to match the dfd I got from linear mixed effect model?
How did you do it, if I may ask?

Thanks.

All the best,
Shuanghe
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2012-01-19 15:24
(4842 d 09:18 ago)

@ Shuanghe
Posting: # 7964
Views: 7,620
 

 Import from external source

Dear Shuanghe!

❝ […] I was stuck in boundy, and consequently, critbound.

❝ So my question is, how to calculate this "CINV" in Phoenix? I mean, I can get the value from SAS, or even from Excel, but that would mean I have to do it manually everytime.

❝ Is there any easy way to do it? or I have to import a table of the inverse chi-square distribution to match the dfd I got from linear mixed effect model?


You discovered an important point. Although both noncentral t and χ² are used internally in Phoenix, they are not accessible as a function in a custom transformation. :-(
I discussed that at Pharsight’s Extranet, in e-mails with the developers, and filed two bugs at the support site. Since you succeeded in getting boundx you have noticed that min() and max() are not available as well (bug 11570). Instead of simply using
  (max((abs(Lower_CI)), (abs(Upper_CI))))^2
I had to workaround
  if(abs(Lower_CI)>=abs(Upper_CI), (abs(Lower_CI))^2, (abs(Upper_CI))^2)

Bug 11571 (inaccessible distributions) will not ‘make it’ in the next release 1.3 – which is already in the final testing stage and scheduled for release end of the first quarter 2012.

❝ How did you do it, if I may ask?


My workaround was essentially your last suggestion. I generated the values in R

options(digits=16)
for (dfd in 1:200) {
  Cinv <- qchisq(0.95, df=dfd)
  cat(paste(dfd, "\t", Cinv, "\n"))
}

and imported the table with column headers dfd and Cinv. In the Estimates of Intermediate Dlat I renamed Denom_DF to dfd, merged with the χ²-table (sort on dfd) and filtered for empty rows (Exclude where [Dependent] is NULL Entire Row). Another option would be a ‘Phoenix Connect’ license. Then it should be possible to obtain the value from one of the following programs: SAS, S-plus, R. I got a trial license and didn’t succeed yet – but I’m not sure whether it is really worth the efforts.

Pharsight is considering to internally code both EMA’s and FDA’s models in a future release (QC_PHX6269). Right now my workflow is rather lenghty (if you want I can send you the project file off-list). Time allowing I will prepare another whitepaper. Since the bug giving slightly different CIs from ABE and LME was fixed in v1.3 probably I will wait for the final release.

Dif-tor heh smusma 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Shuanghe
★★  

Spain,
2012-01-19 23:42
(4842 d 01:00 ago)

@ Helmut
Posting: # 7967
Views: 7,379
 

 Thanks, it's done!!

Hi Helmut,

Now you made my day!! I import a table of CINV and everything works out just fine. I'll have to redo it to tidy the workflow a bit to ease of use for others but that shouldn't present any problem now.

t and χ² are used internally in Phoenix, they are not accessible as a function in a custom transformation. :-(

indeed, far too few functioins in Phoenix.

❝ you have noticed that min() and max() are not available as well (bug 11570). Instead of simply using

  (max((abs(Lower_CI)), (abs(Upper_CI))))^2

❝ I had to workaround

  if(abs(Lower_CI)>=abs(Upper_CI), (abs(Lower_CI))^2, (abs(Upper_CI))^2)


well, that's better than mine. After discovering they don't even have max min, and x**2 is not working as square of x, as SAS would do, I did this:
if(abs(lower_ci) > abs(upper_ci), abs(lower_ci)* abs(lower_ci), abs(upper_ci)*abs(upper_ci)). :crying: Where did you get the idea that ^ means to raise power? :ponder: nice to know.

❝ Right now my workflow is rather lenghty (if you want I can send you the project file off-list).


No, it's not necessary now. But thanks anyway.

By the way, I seems to get slightly different CI as well. I need to run more SAS to confirm it but the difference I got is usually very small, always happens to the last decimal. But imagine some day you have 125.01% instead of 125.00%..., there would be a lot of :blahblah: with regulator to get the approval. or not.

All the best,
Shuanghe
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2012-01-20 01:10
(4841 d 23:33 ago)

@ Shuanghe
Posting: # 7968
Views: 7,466
 

 Thanks, it's done!!

Dear Shuanghe!

❝ After discovering they don't even have max min, […]



I couldn’t believe this first. Was available up to WinNonlin 5.3…

❝ […] and x**2 is not working as square of x, as SAS would do, I did this:

if(abs(lower_ci) > abs(upper_ci), abs(lower_ci)* abs(lower_ci), abs(upper_ci)*abs(upper_ci)). :crying: Where did you get the idea that ^ means to raise power?


Old habits. I knew from ‘classical’ WNL that both X**Y and X^Y work in ASCII-models, but only the latter in worksheets (similar to Excel). Safes one keystroke. :-D

❝ By the way, I seems to get slightly different CI as well. I need to run more SAS to confirm it but the difference I got is usually very small, always happens to the last decimal.


Hhm. The second decimal is not enough. I consider a successful ‘cross-validation’ if results agree at least to the third decimal (rounding!).

❝ But imagine some day you have 125.01% instead of 125.00%..., there would be a lot of :blahblah: with regulator to get the approval. or not.


Would only cost money. Imagine the other way ’round: You get the approval with 125.00 and after two years of marketing the drug some guy at an agency recalculates the data with SAS. Not so nice.

Dif-tor heh smusma 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
JMCardot
☆    

France,
2012-01-31 04:12
(4830 d 20:31 ago)

@ Helmut
Posting: # 8020
Views: 7,473
 

 SAS and missing values

Dear all,

I run the SAS procedure either with GLM or MIXED (SAS 9.2 under W7) using the EMA dataset with 77 subjects (having missing values) asking for "solutions" to be certain of the calculations (model = .../solution) and residual. The subjects having missing values (i.e. subject for 2 period over the 4 for example) are keep in the analysis that being also visible on the DF of the subject. Results are globally identical to Phoenix results (except for intercept in the solution).

If needed I can send the pdf file of the results of the various models in order to discuss the results.

JM
UA Flag
Activity
 Admin contact
23,424 posts in 4,927 threads, 1,670 registered users;
26 visitors (0 registered, 26 guests [including 6 identified bots]).
Forum time: 01:43 CEST (Europe/Vienna)

The true Enlightenment thinker, the true rationalist,
never wants to talk anyone into anything.
No, he does not even want to convince;
all the time he is aware that he may be wrong.    Karl R. Popper

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5