In a design with on fixed factor we define several experimental groups (factor levels) and measure a variable in different subjects within each experimental unit. This is the case of one Control group treated with a placebo compared to three treatments. In this case the factor is the treatment, with four levels (placebo and three treatments) A linear model for one fixed factor is defined as: $$ y_{ij}=\mu + \alpha_i + \epsilon_{ij}$$ Where \(y_{ij}\) is the \(j^{th}\) observation in the \(i^{th}\) group (level). \(\mu\) is the mean of the results if there is no effect of the factor. \(\alpha_i\) is the effect (additive) of the level \(i\). Thus, the expected mean in the \(i^{th}\) group is \(\mu_i=\mu+\alpha_i\) Finally, \(\epsilon_{ij}\) indicates the random variation around the mean. It is assumed that the random variation follows a \(N(0,\sigma)\) distribution.

After obtainning simulated samples for each group, the application computes the total sum of squares (SST), the residual sum of squares (SSR), and the sum of squares between treatments (SSTreat).

You can indicate the levels of the factor and the size of the effects of each level with respect to the global mean (that is the mean without any effect).

Here, we simulate a number of samples from the selected conditions. Fro each sample, a linear modell is fitted and the corresponding p-value is stored. When the effects are different from 0, the % of samples with p<0.05 approximate the statistical power for discovering the difference. If all the effects are 0, we expect that a 5% of the sample will produce a p<0.05 (significance level). The histogram reflects the results obtained. If the power is low, you need to increase the sample size.

First compute a linear model for the means of Biomarker by group

`res <- lm(Biomarker~Group)`

The anova table can be obtained as:

`anova(res)`

A summary will produce the coefficients of the linear model:

`summary(res)`

The estimation of the CI for mean differences is obtrained as:

`TukeyHSD(aov(res)`

And the plot of the CI as:

`plot(TukeyHSD(aov(res))`