Variable names, lexical order? [Regulatives / Guidelines]

posted by Helmut Homepage – Vienna, Austria, 2023-04-21 17:45 (364 d 18:26 ago) – Posting: # 23535
Views: 1,449

Hi David or Guo,

❝ 1. […] please change my username as "Weiguo21224" at your end.


Done.

❝ 2. I carefully reviewed previous discussion. My understanding is that "T" and "R" in FDA code do represent the "Test drug" and "Reference drug" respectively.


Correct so far.

❝ It should be:


❝ ESTIMATE 'T (the large/later one in lexical order, Reference drug) vs. R (the small/early one in lexical order, Test drug') TRT 1 -1/CL ALPHA=0.1;


❝ Right?


In your example and the FDA’s code, yes and no. Alphanumeric codes are internally converted to factors in lexical order and integers by default. At least in all software I know. Examples in [image]:
  1. trt <- as.factor(c("T", "R"))            # T > R
    print(trt); print(as.integer(trt))
    [1] T R
    Levels: R T
    [1] 2 1

  2. trt <- as.factor(c("Test", "Reference")) # Test > Reference
    print(trt); print(as.integer(trt))
    [1] Test      Reference
    Levels: Reference Test
    [1] 2 1

  3. trt <- as.factor(c("A", "B"))            # A < B
    print(trt); print(as.integer(trt))
    [1] A B
    Levels: A B
    [1] 1 2

  4. trt <- as.factor(c("tablet", "capsule")) # tablet > capsule
    print(trt); print(as.integer(trt))
    [1] tablet  capsule
    Levels: capsule tablet
    [1] 2 1
In all examples – except the third – the levels of the factors are internally reordered. If you are interested in the contrast (difference) of estimated treatment effects, you have to tell the software which of the treatment is the reference. If you don’t, the one with the internally smallest integer will be subtracted from the larger one. Therefore, in the first example you would get R – T instead of the desired T – R.

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

Complete thread:

UA Flag
Activity
 Admin contact
22,988 posts in 4,825 threads, 1,658 registered users;
107 visitors (0 registered, 107 guests [including 4 identified bots]).
Forum time: 12:11 CEST (Europe/Vienna)

The whole purpose of education is
to turn mirrors into windows.    Sydney J. Harris

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