Data structure [🇷 for BE/BA]

posted by Helmut Homepage – Vienna, Austria, 2017-02-08 11:33 (2627 d 09:58 ago) – Posting: # 17036
Views: 17,788

Hi StatR,

 Subject Formula Period Sequence     Yijk

       1       1      1        1 4.933014

       1       0      2        1 5.006829

       1       1      3        1 4.854162

       1       0      4        1 5.081755

...


❝ Where Yijk is the PK characteristic. The first sequence represents "TRTR" and the second sequence: "RTRT". In the formula 1 = T and 0 = R.


Only a general remark about data structures in R. I suggest to code categorial (classification) variables as characters instead of numeric (Treatment, Sequence). It not only helps others to understand what you have meant without requiring an explanation (1=TRTR, 2=RTRT and 1=T, 0=R) but also models (e.g., lm(), lme(), lmer()) will automatically treat them as factors. Avoid Formula and use Treatment or Formulation instead. Personally I prefer Treatment over Formulation for generality (imagine a food-effect study where we have the same formulation).
Convert numeric variables (except the PK-response) to factors as well:

data$Subject <- as.factor(data$Subject)
data$Period  <- as.factor(data$Period)


❝ Unfortunately, I am confused after reading tons of post, and I could not figure out what is "trt", "tmt" ...


Always the treatment is meant. To add confusion in package bear Yung-jin uses drug. ;-)

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,661 registered users;
100 visitors (0 registered, 100 guests [including 3 identified bots]).
Forum time: 22:31 CEST (Europe/Vienna)

The only way to comprehend what mathematicians mean by Infinity
is to contemplate the extent of human stupidity.    Voltaire

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