All right. Hello, everybody. Today we're gonna be doing some more modeling. So first things first. As always. You want to make sure you have be Wooldridge package installed. This package contains all the data, and then you want to just select the world rich library. Make sure we're using that. Um, we're gonna be using one equation or one. We're gonna be referencing one previous equation. That's gonna be log wage. Actually, it's gonna be L wage, as it's referred to in the data set, is equal to base Eclipse University experience. It's good to have that written down. So we can for back to it. And all right, let's get started. So first, we're talking about the S total variable, which refers to standardize test total, and it's a proxy variable for un observed abilities are first thing we want to do is we want to find our sample mean and standard deviation we were going to do that is very simply that the data set So our data set is two year that will select that one of you two year weaken. View that now, over here, you can see all these different things. If I scroll you will see you know, the various different categories. So, um, to find the mean and standard deviation Very easy function. We're just gonna take the mean off the S total column in two years. And then we're gonna take the standard deviation of the S total column into your perfect right there very quickly. We have our mean and rest and deviation. So now we want to run some basic aggressions. We want to run a regression of J. C. On s total and of university on a So and we want to find out, Are they statistically related? So that's pretty simple. We're gonna say R J c regression is gonna be a linear model, right? And it's very simply, our formula is just gonna be that of J. C on total Y on X obviously referencing the two year data set and then our university regression is gonna be the exact same bring. But instead of J. C, we're gonna write university. And then again, Data said, he's I think the summary of these JC wreg and summary of you know right you will see for a J. C wreg Um, thes s total is not statistically significant, right? It's 0.31 You will also see for university, however, is statistically significant. Um, you can see that from the three Asterix here, showing its significant at the 30.1% confidence level. So it's obviously a significant at five or also from the fact that our probability is less than two times sentenced to 16. So Okay, um, it is statistically significant in determining university, but not J. C. All right, cool. So now we want Teoh. Now we want Teoh take our equation from before up here This l wage Ah, um, to J C University and Experience. And we want to add s total into that. So are primary model is going to be lm Elway's being C plus university puts experience, and now we're gonna add in as total our data state is still two year. When we take the summary of our primary model, you will get this again notice Everything is significant at the five and also at the 50.1% confidence levels. But there seems to be no real difference in the conclusion drawn because, um, you know, both JC and university are still statistically significant with or without s total in the model. And if you want me toe, really click do that. I can actually just do summary of l m l. Wage Juicy plus university experience. Data equals two year. You can see that even without, um as total all of these air still statistically signify Right. Okay, Cool. So, um, now we want to test the hypothesis that the returns are these same against the alternative that the return toe four year colleges greater. So there are a few of doing a few ways of doing this. The one I like is actually a little method where our formula will change to make our lives easier. So instead of saying J C plus university plus experience plus esto, we're gonna have J. C. Plus, uh, let me check the column name again. Just a warning. So you'll see. We have Ah, somewhere in here we should have. Yeah, we have a variable called Total College, which basically adds together R J c. And our university, right? The number of years and that variable combines those two variables. So if we want, say so, if our, um no hypothesis is B one equal to be too right where B one is The coefficient for J. C. B two is equal to university and our alternative hypothesis I mean, start commenting. Visit are all turned. This hypothesis is B one is less than right. Weaken Ben, rewrite this, as are no hypothesis being the one minus B two equals zero and you one minus beat you is lessons here. Now, Now, if we put these if we combine be one minus B two into one variable. Right? Um so basically, what we can do is we can change our equation around and instead of, um saying J C plus University, right, with two separate variables, we make a J C plus total college, and then the coefficient for J. C will be This represent will represent the one minus B two because we'll take out everything that's B two, and we'll tack it on to university with the total college. Very, it's a little bit confusing, but it's, um it's my preferred method for doing these multi, um, multi variable hypotheses. So basically our new model, it's going to be lm l Wage is going to J C plus tote call used at the right variable name I almost forgot. Yeah. J C plus toe call plus experience. Plus s total. Dana equals two year. And then if we take a summary of our new model, we will find that J. C is no longer statistically significant, Which means that we that we reject the alternative hypothesis. We're sorry we don't reject the alternative hypothesis. We failed to reject the null hypothesis, which is that there is, um no diff. So, yes, there does seem to be no difference in the conclusion drawn between two year and four year colleges, with or without s total in the model. We know that without from before Okay, that was a doozy. Let's just run through this one more time. Really Quick. We have are null hypothesis B one equals B to basically saying that you have these two j. C. And university or the same. We we've rearranged our equation, so we only have to account for one variable, essentially read or not equals zero vs Straight on. Not is less than zero. Right, And we find So this is they don't not. We find that our probability here is point for 21 which means that there is no statistical significance. We failed to reject the null hypothesis. And, um, that there isn't a difference essentially between two and four year colleges. Okay. You all right? So now we're gonna, um we're going toe Ask for our equation from here. Sorry. No for equation here. We added s total up here, right? Same equation. Added Estelle. Now we're asking, Do we require quadratic for this equation? So our model squared, right? Just doing in that quarter at it is gonna be l wage. They see, plus university plus experience plus s total and now are quadratic. Um, very well, we're gonna write I as total squid. You need the eye to make sure that, um that the formula reads as you squaring it and not doing something else. We're because our is a funny language. All right. When I take this summary of this model, I will find that this is not statistically significant at all. It's probabilities 0.69 and that's not statistically significant at the 5% confidence of were really any reasonable confidence level. So we don't require a quadratic variable to determine l wage. Okay. Now, um, we want to add the now we want to try the same thing again, right? We want to add something and see if it's necessary. But we're gonna try with the interaction terms as total times, J C and s Total Times University. So we're gonna try it with those interaction terms and see if the mob, if they're jointly significant now, joint significance is a bit different. And I'll explain that in a second. So our model interact right with our interaction crimes always J c University experience as total. And then we're gonna have as total times J. C and S Total Tang's University agreed A is going to be two years. All right. Summary of this model. Oh, yeah. You can say from here that Oh, neither of these are statistically significant of 5%. But that doesn't actually give you their joint significance that gives you the individual significance is of these to get the joint significance. What we're gonna do is we're in use a function called a nova. We're gonna put our restricted modeled first. That's the primary model. Then we're gonna put our unrestricted model second. That's our interaction. Well, if we want this ucr degrees of freedom decreased by two makes sense because we added in two more terms, and our probability of this happening is tweet one for one. Now, since the P value of this is an F statistic, right, that's all this is, since the P value of R F statistic is greater than, um, the critical P value of 0.5 right, which is our 5% significant several since is greater than that. Both of the interaction terms are jointly statistically insignificant at the 5% level between both of them can get thrown out. So our final model that controls for will be using s total is going to be not right. This here, the log away equals, and I'm gonna read this with the intercepts, so be no. That's our intercept. Plus B one J c. Must be to university again. Those are just coefficients. B three experience was be for s total. Plus, are you for error? That is going to be the final equation. We use Teoh make our model controlling for, um ability. All right. And that's all. Thank you very much. Have a good day