BEQool
★    

2024-06-27 14:25
(281 d 10:14 ago)

Posting: # 24042
Views: 3,615
 

 Standard deviation of different designs [General Sta­tis­tics]

Hello all!

Would anyone know what are the equations to calculate standard deviation of a study for different study designs (2x2, 2x3x3, 2x2x3, 2x2x4)?
For example, standard error of a study for a given parameter is given in Phoenix Winnonlin with "Diff_SE" in the "Average Bioequivalence" tab but I cannot either find or calculate its standard deviation.

I assume it has something to do with coefficients and number of subjects in sequences like in known.designs() but I cant get my head around it :confused:

BEQool
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2024-06-27 15:29
(281 d 09:10 ago)

@ BEQool
Posting: # 24043
Views: 3,078
 

 Standard deviation of different designs

Hi BEQool,

❝ Would anyone know what are the equations to calculate standard deviation of a study …

I’m not sure what you mean by that. Can you reword/explain please?

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
BEQool
★    

2024-06-28 09:35
(280 d 15:04 ago)

@ Helmut
Posting: # 24045
Views: 3,058
 

 Standard deviation of different designs

❝ ❝ Would anyone know what are the equations to calculate standard deviation of a study …

❝ I’m not sure what you mean by that. Can you reword/explain please?


Sorry for the confusion, I meant standard deviation of a difference between treatments for a certain parameter. Now that I am thinking about it again, is it just the square root of MSE and therefore doesnt depend on the design?

BEQool
ElMaestro
★★★

Denmark,
2024-06-30 00:08
(279 d 00:31 ago)

@ BEQool
Posting: # 24046
Views: 2,993
 

 Standard deviation of different designs

Hi BEQool,

❝ Would anyone know what are the equations to calculate standard deviation of a study for different study designs (2x2, 2x3x3, 2x2x3, 2x2x4)?

❝ For example, standard error of a study for a given parameter is given in Phoenix Winnonlin with "Diff_SE" in the "Average Bioequivalence" tab but I cannot either find or calculate its standard deviation.


❝ I assume it has something to do with coefficients and number of subjects in sequences like in known.designs() but I cant get my head around it :confused:



If I am not mistaken, you are looking for the standard error of the treatment difference, which is used to construct a 1-2*alpha Confidence interval. I agree, this is not all that easy.
One thing is to apply an easy equation from Chow & Liu which works well in the case of a simple 222BE design, but it can get more obscure if the design gets a little complex.

For a general approach, you can derive the covariance matrix, V, for the fixed effects. If X is your model matrix (=design matrix) and you have fitted your model and extracted your MSE from that model, then you simple have
V=MSE*(X'X)-1

If treatment A is indicated by the column a in X, and treatment B is in the column b of X, then V[a,a] is the SE of A and V[b,b] is the SE of B. V[a,b]=V[b,a] is the covariance of the two, hence:
SEdiff=SEA+SEB-2CovAB

If you program in R here is a little snippet for you to play with, and it may be handy for you to have the emmeans package installed.
R turns out to have a very handy function called vcov which directly gives us V without us having to do the underlying matrix algebra. I hope the following is illustrative:


library(emmeans)
set.seed(148923)
Seq=rep(sample(rep(c("RT", "TR"), 5)),2)
Per=c(rep(1, 10), rep(2,10))
Trt=substr(Seq,Per,Per)
Subj=c(rep(c(1:10),2))
lnCmax=runif(20, 100,150)
data.frame(Subj, Per, Seq, Trt, lnCmax)  #just some invented data for a 222BE trial
M=lm(lnCmax~0+Trt+factor(Per)+Seq+factor(Subj)) #I am fitting without intercept and Trt first!
V=vcov(M)
V[1:2, 1:2]  #show me the first two columns/rows
SEd=sqrt(V[1,1] + V[2,2] - 2*V[1,2])
confint(pairs(emmeans(M, "Trt"), reverse =T))
# Is the SEd the same as the SE from the confint/pairs object?
SEd
# Yes it is. Perhaps ElMaestro occasionally is right after all?


You can extend this as necessary.
Be careful about intercepts and the order of factors in your lm.

Pass or fail!
ElMaestro
BEQool
★    

2024-07-01 09:25
(277 d 15:14 ago)

@ ElMaestro
Posting: # 24047
Views: 3,059
 

 Standard deviation of different designs

Hello ElMaestro,
thank you for your in-depth answer, I will take a deeper look into it.

❝ If I am not mistaken, you are looking for the standard error of the treatment difference, which is used to construct a 1-2*alpha Confidence interval.


I am not exactly looking for the standard error of the treatment difference but instead for its standard deviation. I am using Phoenix WinNonlin and standard error of the treatment difference is already given with "Diff_SE". I would like to find out how to get (if it is possible) standard deviation of the treatment difference from the standard error of the treatment difference "Diff_SE" (or is there some other way?).

BEQool
ElMaestro
★★★

Denmark,
2024-07-01 09:38
(277 d 15:01 ago)

@ BEQool
Posting: # 24048
Views: 2,975
 

 Standard deviation of different designs

Hi BEQool,

❝ I am not exactly looking for the standard error of the treatment difference but instead for its standard deviation. I am using Phoenix WinNonlin and standard error of the treatment difference is already given with "Diff_SE". I would like to find out how to get (if it is possible) standard deviation of the treatment difference from the standard error of the treatment difference "Diff_SE" (or is there some other way?).


Yeah, that is confusing, too.
We have all kinds of standard deviations, but the one we usually learn about is the standard deviation of a sample.
But if we have a sample, then we also have a mean from it, and the standard deviation of that mean is called a standard error. When statisticians derive a standard deviation of a mean (in contrast to a sample), then they tend to call that a standard error. My suspicion is they are solely doing it to confuse people like me. So, I think the answer to your question is that the SE of the difference is the standard deviation of the difference.

I can't help with WNL at all. What it does, how it does it and how it presents results to the user is entirely outside my competences.

Pass or fail!
ElMaestro
BEQool
★    

2024-07-01 10:41
(277 d 13:58 ago)

@ ElMaestro
Posting: # 24049
Views: 2,937
 

 Standard deviation of different designs

❝ My suspicion is they are solely doing it to confuse people like me.


Yes you are not alone in this :-D

❝ So, I think the answer to your question is that the SE of the difference is the standard deviation of the difference.

❝ I can't help with WNL at all. What it does, how it does it and how it presents results to the user is entirely outside my competences.


Thank you!
I will also ask this on Certara forum if they have different perspective.

BEQool
mittyri
★★  

Russia,
2024-07-01 13:18
(277 d 11:21 ago)

@ BEQool
Posting: # 24051
Views: 2,978
 

 Standard deviation of different designs

Hi BEQool,

❝ I will also ask this on Certara forum if they have different perspective.

They won't :-)
ElMaestro is right

Kind regards,
Mittyri
ElMaestro
★★★

Denmark,
2024-07-03 15:37
(275 d 09:02 ago)

@ ElMaestro
Posting: # 24060
Views: 2,831
 

 Standard deviation of different designs

Hi all,

typo above:

❝ SEdiff=SEA+SEB-2CovAB

is nonsense.

It should be more like:

SEdiff2=VarA+VarB-2CovAB

Pass or fail!
ElMaestro
UA Flag
Activity
 Admin contact
23,413 posts in 4,924 threads, 1,667 registered users;
54 visitors (0 registered, 54 guests [including 9 identified bots]).
Forum time: 00:40 CEST (Europe/Vienna)

Nothing shows a lack of mathematical education more
than an overly precise calculation.    Carl Friedrich Gauß

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