 Okay, so now we've done the first two steps. We've created a specification grid in the first steps. So let's have a quick look at mod specs. In the second step, we've taken a specification ID and we've created a function that returns the results of a regression model just based on that ID alone. So for instance, we can do getLM1, which gives us the result of the first model. Now we can go into the third step, which is to run the regression model for each of the specifications within the model specification grid. Obviously we don't want to just run out getLM96 times, as that would take far too long. Instead, we can use the map function, which is from the per package, which is within the tinyverse, to do this repetitive step. Now map has a unique syntax. So I'm gonna quickly demonstrate how it works using a toy example. Map is an iterator function. It takes an object and applies a function to each element of that object, returning the results of the list. Let's have a quick look. So here we're gonna input the vector two to five. So that's two, three, four, and five. And we're just gonna add 16 to each of those numbers. So we get back a list of length four, 18, 19, 20, and 21, two plus 16, three plus 16, four plus 16, and five plus 16. So the way that I've told map to do this function, this plus 16 function, is using something called lambda notation. We have this tilde and this dot x placeholder, which is just a placeholder for the current value of the object being looped over. So in the first case, dot x is two. In the second case, it's three and four and five. And that's why we have the results 18, 19, 20, and 21 stored as a list. We can use map to loop over the set of spec IDs that we have in our model specification grid and run getlm for each one. Mod specs, dollar sign, spec ID. So mod specs, spec ID, is just a vector going from one to 96. So we can loop over that in the same way that we did just adding 16 in the previous step. So here we'll just run getlm on each of these numbers. Now that's going to take a little time to run, but you'll see that it's returned a list of length 96 because we've got 96 different models. And this last element is the result for the very last specification. This is the, this 95th one is the result for the penultimate specification and so on. Now getting back the data in this format isn't very helpful. One, because it's in a list and two, because it doesn't tell us what model specifications these results correspond to. We can't easily see what the specification was for this particular regression that was run. So what does this 90th, 96th result actually mean? Instead, we can use a very neat feature of data frames within R, which is something called a list column. So let's just look at mod specs again. At the minute, mod specs is just a standard data frame where we have five different columns and each of these columns is a vector. In R, a vector is a set of values that are of the same type. So for instance, spec ID is a list of integers. Covars is a list of character vectors or strings. That's also true of cog far. Fub is an integer and then cohort is a factor variable. So what we can do is have a list as a column within a data frame too. And as I say, map returns a list so we can put the result of a map function right into this mod specs data frame by using map within a mutate command. Mutate is used to create new columns. So here, we'll just create a new column called res which is gonna contain the results of this 96 regression models. So let's just quickly run that now. Okay, we'll take a little while to run again. Right, so now you see we have this new column res which is a list of tables. Each of them has one row and five columns, like dimensions one by five. And that's because each of them is just a table like this. It's returned by the getLm function. Now, this doesn't work very well because we can't see the results directly. We can just see we've got this list of tables. So instead, we can use the unnest function to explode out the res column into the wider data frame. So instead of having a list of tables, we'll have five new columns containing the information that was in res. So estimate standard ROP value, confidence interval, low and high. So let's just run that again and add an unnest function. Okay, there we go. We've still got 96 rows in the original five columns, but we also now have the extra five variables, estimate, standard error, P value, conflo, and conf higher. You can't see conf high, but it's just printed there. We can see that the association age 15 for baby boomers using the non-verbal cognitive ability variable and the basic set of covariates was minus 0.169. Let's just save this as mod-res. Oh, mod-press, sorry. And let's just show that off again. And there we have it. We've got the results of 184 regressions. It was very simple to run. Thank you.