Hi everybody, in this lecture we will discuss the distinction between within and between-independent sampling unit factors. This is something we have talked about in passing. In this lecture we will dive a little deeper. Our learning objectives are to be able to define each types of these factors, so you're able to recognize and differentiate between them when you come across them in your work. Differentiating between those two types of factors is key for conducting data analysis, and therefore an important part of power and sample size analysis. Remember that when we were talking about factors we were referring to something in the study which affects the observations. There are different types of scales that factors can be on, categorical, ordinal, interval, and ratio. Categorical scales include groups that are non-numeric and in no particular order, such as a treatment versus control group. Ordinal scales are non-numeric, but are in a particular order. Interval scales are numeric, but there is no true zero value. So for example, a value of 40 is not necessarily double a value of 20. Finally, a ratio scale is a numeric and includes a true zero value. Let's remind ourselves what an independent sampling unit is. Along with our official definition we've been using, we can simply look at the independent sampling unit as a way of describing chunks of data. So that when between the chunks the observations are statistically independent of one another. Longitudinal studies typically have both within and between factors. Within factors are those measurements or observations which vary within the person or independent sampling unit. For example, we've talked about time. If a study has a factor of time, then the repeated measures which could be collected at 0, 3, 6, 9 and 12 months, for example, then that's a within factor with the same independent sampling unit is measured repeatedly. For between factors the values is constant for that person or independent sampling unit, and it applies to the independent sampling unit as a whole. For example, in a randomized trial patients are randomly assigned to drug a or drug b, what commonly happens is researchers will measure something like patients blood pressure at baseline, and then start giving them the drug. Then the patients are measured perhaps at 3 months, 6 months, 9 months, and 12 months. This is a common longitudinal study where the within-independent sampling unit factor is time, and between-independent sampling unit is the drug that you are giving. Within-independent sampling unit factors can vary over space, time, or location. We have already talked about within factors that occur over time. Another example would be within factors over space, such as a study where you are measuring values at different distances away from something of focus. For example, measuring blood vessel diameter at different distances away from the heart. Another example of within factor could be looking at measurements of a digit of the hand. Or by measuring different parts of a plant or different limbs of an animal. These would be within factors that vary in location. The key to all of these within factors is that a within-independent sampling unit is being used. Between factors, on the other hand, have only one value assigned, the independent sampling unit, and vary between groups. For example, independent sampling units are either getting a drug intervention or placebo, or currently at different grade levels or they're getting different dosages of drugs based on their group. Factors can also be classified as observational or interventional. The distinction between them is observational factors are naturally occurring. Interventional factors, on the other hand, are assigned to people. For example, we can assign whether or not you eat vegan lunch or non-vegan lunch. This would be an interventional factor. However, we can't assign your age, you bring that with you, making it an observational factor. We care about these decisions because we need to get them to do power and sample size analysis. And the software we're going to use shows you and asks you questions pertaining to these types of things. Some designs only have within-independent sampling unit factors, and some designs have between factors. But typically, longitudinal studies that we have have some within and between. Longitudinal studies can have pure within factor design, but they cannot have pure between factor design, as there would be no longitudinal features of measurements repeated over time. Here's an example of a pure within factor design. This is called a crossover design to compare two drugs, where participants receive one drug, have a washout period, and then take another drug. The participants are measured throughout the study over time to test the effects of each drug. The order is changed for half of the participants to counterbalance possible order effects. But this is a pure within-independent sampling unit factor design, because there aren't any separate treatments. It simply looks at how each drug affects every patient over time. Here is an example of a pure between-independent sampling unit factor design. There are no within factors, simply participants are being assigned to receive only one drug or the other, and the measure of effectiveness is at one time. Most longitudinal factors are a hybrid of these and include both within and between factors, like this example. Patients are randomly assigned to receive only one drug or the other, and then the participants are measured repeatedly over time. Here's an example with a pure within that includes observational factors. As gender is an observational factor and not something we assign to certain participants. In this example, 100 women are measured three times over the course of the study. This time, within-independent sampling unit factor in gender is an observational factor. Here's an example of a pure within design with interventional factors as well. We have three conditions, which are treatments A, B, and C, which act as interventional within factors. Each drug is assigned to each woman in this study, and there is also measurement for the treatment. In this example, the within-independent sampling unit factor is treatment, as treatment is assigned to each women, making it an interventional factor. Here's an example of a pure between design with observational factors. Once again, the observation factor here is gender. The difference is, however, now there are women and men. So these participants are separated by groups, making gender a between subject factor. In studies like these we can look at gender differences in purely between-independent sampling unit designs. Finally, here we can see a pure between design with interventional factors. Here we are talking about a group of people, Coloradans, and randomly assigning them to treatments, and taking one measurement from each participant. Because they are assigned a treatment, this is an interventional factor. It is very common, however, to have both between and within designs. When you do this, you get to ask and answer more complex questions. For example, instead of just saying, is the treatment more effective or ineffective? You can ask how does the treatment of participants affect initially, after three months, after six months? The advantages of this type of design are enormous. We're going to look at how between and within factors shaped a couple of longitudinal studies. One observational longitudinal study and one interventional longitudinal study. Let's start with an observational longitudinal study. This is a nine-month study looking to compare the pain levels of male and female participants following a root canal procedure. 50 men and 50 women were recruited. Gender is the between-independent sampling unit factor. Each participant already required a root canal, as I don't think you need, and could, ethically go out to recruit people to take a root canal who do not need it. The memory of pain for each participant was measured immediately following the procedure. And at 3 months, 6 months, 9 months, and 12 months after the procedure. The factors between tested were between factor gender and within factor of time. If the study only looked at time it would probably not be very interesting, as you'd expect pain perception to decrease over time. But what between factor allows us to explore is whether or not the pattern of decrease in pain perception over time is different as a function of gender. Here's the flowchart of what happened in the study. Men and women who were recruited took part in the root canal procedure and then were measured five times in total, if you include immediately following the procedure. Once again, the within factor here looks at how the pain levels of independent sampling units or patients change over time. The between factor in this study compares the pain levels of females to the pain levels of males. Once again, this is considered an observational longitudinal study, because gender is an observational factor. Having a hybrid of these factors, a between-by-within design, allows us to compare the patterns of patients' pain and the difference in pain by gender over time. We would call this a gender-by-time interaction. Now we will look at an interventional study that is longitudinal in nature. And in this study participants were randomly assigned to intervention or no intervention groups. This is the same study we discussed in the previous lectures, where the intervention group listened to an automated instruction to focus on physical sensations in their mouth, while a control group listened to a neutral topic. The flowchart looks the same as the observational longitudinal study, because both studies include the same within factor of time, where each participant reports their pain at 3, 6, 9, and 12 months following the procedure. As we just talked about, the within factor here is time, and it allowed researchers to compare the pattern of pain over time. The between factor is the intervention versus non-intervention, which allowed researchers to compare the pain reported by the intervention group to the pain reported by the control group. The within-by-between design allows us to see patterns of differences in pain over time based on treatments. This time the interaction that is being explored here is treatment by time. As you can see, both studies had longitudinal features of repeated measures over time. The difference between the studies was that one explored an interventional between factor, which was treatment, and the other explored an observational between factor, which was gender. Let's do a review summary of what we learned in this lecture. We talked about between and within factors. Between factors, such as treatment or gender, assign a single value to the independent sampling unit as a whole. And the independent sampling unit will either be part of a treatment group or part of the control group, making this a between subject factor. A within factor results in multiple different values occurring within an independent sampling unit, like if a participant is measured once a week for a month. The example you see here with space could be something if like a river's depth was occurring and recorded every mile. We took a look at between-by-within designs so you can look at answering more complex research questions and look at patterns of response treatments over time with within factors. That's all for this lecture, thank you for your time.