BEQool
★

2024-06-27 14:25
(36 d 21:12 ago)

Posting: # 24042
Views: 1,606

## 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

BEQool
Helmut
★★★

Vienna, Austria,
2024-06-27 15:29
(36 d 20:08 ago)

@ BEQool
Posting: # 24043
Views: 1,437

## 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 🖖🏼 Довге життя Україна!
Helmut Schütz

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

2024-06-28 09:35
(36 d 02:02 ago)

@ Helmut
Posting: # 24045
Views: 1,410

## 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
(34 d 11:29 ago)

@ BEQool
Posting: # 24046
Views: 1,339

## 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

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
(33 d 02:12 ago)

@ ElMaestro
Posting: # 24047
Views: 1,300

## 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
(33 d 01:59 ago)

@ BEQool
Posting: # 24048
Views: 1,293

## 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
(33 d 00:56 ago)

@ ElMaestro
Posting: # 24049
Views: 1,269

## 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

❝ 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
(32 d 22:19 ago)

@ BEQool
Posting: # 24051
Views: 1,268

## 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
(30 d 20:00 ago)

@ ElMaestro
Posting: # 24060
Views: 1,170

## 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