# New Treatments as Fixed Effect

We will now use the data set from Dr. Jennifer Kling, that we referred to earlier (http://pbgworks.org/sites/pbgworks.org/files/ExampleData.txt). In the data file we see that there are five columns containing the values of Plot, Entry, Name, Block, and TSW. Recall that the plot refers to the ID of the plot, entry refers to the ID of the genotype i.e. the plant variety, the block refers to the block in which the plot is located and finally the TSW contains the corresponding 1000-seed weight from the yield. Further plot, entry, name, and block are categorical variables i.e. factors with levels, and TSW gives a measure of the oil content.  Seeds with more oil will weigh more.

So in the Entry as a fixed effect model let's say we want to find the relationship between TSW, Block, and the Entry. Further this model implies that we treat Entry as fixed and Block as random. Thus our model can be thought of as:

TSW depends upon Entry treated as fixed and Block treated as a random effect,  and the error term.  This error term represents the deviations or the random parts of the model that we cannot control/model experimentally.   Lets write the relationship as:

TSW ~ Entry + (1|Block) + error term  (** We are using a vertical bar between "1" and "Block", you may find the vertical bar on your keyboard above the return key)

or

TSW ~ Entry + (1|Block)  (lets remove the error term for R)

What we have done above is that we have translated our model into a notation that R understands as a definition of a model, where Entry is treated as fixed (since we do not have the parenthesis and the | around "Entry") and Block is treated as a random effect (since it is surrounded by a parenthesis and prepended (i.e. prefixed) by "1|" . The word prepended is often used in computer instructions and essentially means something in beginning of something else.

Let's make sure you fully understand the concepts we've been discussing up to this point by asking you a couple of general questions.

## Quiz

Question

Question : A linear model  represented as TSW ~ 1 + (1|Entry) implies that we are fitting a model where we are interested in :

Looks Good! Correct: Explanation: Surrounding a factor by a parenthesis represents the factor as a random effect in R.
Question

Question : If the linear model was represented as TSW ~ 1 + (1|Entry) + (1|Block) it would imply:

Looks Good! Correct: Explanation: Surrounding a factor by a parenthesis represents the factor as a random effect in R.