Oops. [Regulatives / Guidelines]

posted by ElMaestro  – Denmark, 2011-11-04 17:22 (4930 d 02:43 ago) – Posting: # 7610
Views: 9,037

(edited on 2011-11-04 22:36)

Hi Hs,

❝ I have no idea how to simulate CVintra; CVtotal is not what I really want (to see if reference’s different variances have an influence on the result).


Neither had I when I started this thread, but now I have and I don't think it is difficult. Our model (simplest case but not satisfying d_labes' concern):

y~Seq+Subj+Treat+Per+error

There is one error in play unless we do a mixed model. So we sample the error (intrasubject) from a normal distribution and add it to the fixed effects. We can set the fixed effects to zero for Per and Seq, and tweak the Treat's as per our wishes for T/R ratios.

Edit:
The following code possibly shows what I suggest (and I am as always probably wrong):

Per=c(1,2,3, 1,2,3, 1,2,3, 1,2,3, 1,2,3, 1,2,3, 1,2,3, 1,2,3, 1,2,3, 1,2,3, 1,2,3, 1,2,3)
Subj=c(1,1,1, 2,2,2, 3,3,3, 4,4,4, 5,5,5, 6,6,6, 7,7,7, 8,8,8, 9,9,9, 10,10,10, 11,11,11, 12,12,12)
Trt=c(1,2,3,1,2,3,1,3,2,1,3,2,2,1,3,2,1,3,2,3,1,2,3,1,3,2,1,3,2,1,3,1,2,3,1,2)
Seq=c("ABC","ABC","ABC","ABC","ABC","ABC","ACB","ACB","ACB","ACB","ACB",
"ACB","BAC","BAC","BAC","BAC","BAC","BAC","BCA","BCA","BCA","BCA","BCA",
"BCA","CBA","CBA","CBA","CBA","CBA","CBA","CAB","CAB","CAB","CAB","CAB","CAB")

intraCV =0.3 ##30 percent CV
##CVintra=sqrt(exp(MSE)-1)

MSE=log(1+intraCV^2)
Trt.effects=c(0.9, 1.0, 0.95) ## or whatever the truly should be cf. Martin's suggestion

##a simulation loop should start here!

## now we make the y vector
AUC=rnorm(36,  mean=0, sd=sqrt(MSE)) ##first the error/noise
for (i in 1:36)
 {
   foo=Trt[i]
   AUC[i]= AUC[i]+Trt.effects[foo] ##and here we add the fixed effect
 }


##..and analyse from here

I have not debugged so it is prolly full of errors.

Pass or fail!
ElMaestro

Complete thread:

UA Flag
Activity
 Admin contact
23,424 posts in 4,927 threads, 1,666 registered users;
81 visitors (0 registered, 81 guests [including 9 identified bots]).
Forum time: 21:06 CEST (Europe/Vienna)

Patients may recover in spite of drugs or because of them.    John Gaddum

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