So let's look at our example. So here I am in the R Studio environment. These one, two, three, first three lines of code, that just tells us what the active directory is on your computer, set that directory as your working directory, and then looks for this file, cafe.csv, and imports it into this variable data. So if we look at the data, there it is. The thing you have to remember is to make sure your R program and that Excel,.csv, file are in the same folder, and it should work fine. So here's the data and here are the senators' names, their state, we're not going to be using that variable. REP means Republican. One is a yes. Zero is a no. How they voted on this particular amendment and the dollar amount that they receive from the auto industry. So I'm going to take a transformation of the data amount. We're going to take the log and I'm going to put it in this variable, Amt1. Note that I have added one to this number. This is a compromised technique. The idea here is that some of the values in the data set is zero and the log of zero is undefined. So I add one just to get around that. Let's run that code real quick. I can look at the first five values of that amount and there they are. So that's the log of the amounts plus one. Here is the regression. Note, vote is our binary dependent variable, Tilda. The independent variable is on the right-hand side. This example is nice because I have a binary variable. Therefore, whether or not they're a Republican or Democrat. Then, here are the amounts in this column vector of the donations that they received, political contributions that they received from the auto industry. Again, we're going to take, run this regression, put it into some variable name, and then run the summary of the variable name, the standard R technique. So I've run the regression and you can see here's the table of the coefficients, they are all significant, at least to the 0.05 level and even more so at the 0.01 level. The intercept term is minus 4.47. The Beta-1 is estimated to be 1.8479 and the coefficient for the amount is 0.49. So let's look at how to interpret those. This is the equation. Here's the intercept term. Here's the Beta-1 for Republican or non-Republican, and there's the 0.4915 for the amount. So from the logit function, we should be able to calculate the logit, the odds, the probability of a YES vote, and also calculate and interpret the odds ratio. So let's do that. I have rewritten the equation up here on the top line. Let's take first an example of a Democrat. So that would mean REP is equal to zero, who has not received any amount from the auto manufacturer. So Amount1 is equal to zero, and actually, Amount1 was actually the log of one in this case. So here, we have it. So really, it's the logit of y is equal to one is equal to minus 4.4. The log odds of a YES vote from a Democrat is minus 4.4. We exponentiate E to the minus 4.4 is 0.01. Then, we can calculate the probability here. So there's a one percent chance they would vote YES on this bill given that they are Democrat and they have received nothing from the auto industry. So let's look at two more cases on the left and the right. One is the case where the senator is a Republican and the other case is where the senator is a Democrat. In this case, they both have received $25,000 from the auto manufacturers. So here's the model. Both of them have the intercept term. Both of them have 0.4915 times the $25,000 amount. It's actually the log plus 1, the amount plus 1 and take the log. Then, notice the Democrat here has a zero for their party affiliation whereas, here, it's 1.8479 times 1 for the Republican party affiliation. Then, if you calculate the number on this side, you get a 235. Here, it's almost 0.5. Exponentiates of the odds of a Republican voting are 10.48 whereas the odds for a Democrat voting is 1.65. Then, we go from odds to probability using the formula, the odds over 1 plus the odds. So in this case, if you're a Republican and you've received $25,000 from the auto manufacturers, you will get the probability of you voting yes as 91 percent whereas, here, if you're a Democrat, the probability of you voting is 0.59 or 59 percent. So that wraps up logistic regression. I encourage you to go through the code. In the R code, I've actually showed you the methodology used to transform the amount variable that's used in precedence paper and I've also included a link to precedence paper within the R-code. I hope that gives you an understanding of logistic regression.