 Okay, so I'm going to finish off problem set 4 in this video. It may take a little while. Feel free to pause and come back to it if you get tired of watching. But I think I can finish out the rest of it from here. So I still have that problem set 4 demonstration project open, and I'm working from there. The last place I left off was finding the mean, and then I actually input the answers into the type section. So I created the code section to actually find it using the R functions, and then I copied it over manually into the type section. I'm going to do the same thing for the sample variance. So we are using sample variance at this point because this is not a population. In fact, in this case, it is a population because it's a population for a single year. But since there's multiple years, it's actually a sample. I sampled a year for the entire world. So this is sample data. So I'm going to use the sample variance and sample standard deviation, and that means I can just use the R functions. So all I need is I need to do the variance of demonstration data for my two variables. I'm going to start with my variable that was the participatory democracy variable. Then I'm going to also get the variable for my Y variable, which was the access to justice for women. And then I want the standard deviation. I could do the square root, but I'm going to go ahead and let R do its whole thing. I'm going to get the R function for standard deviation SD. I'm going to do the one for the participatory democracy, and then I'm going to do the one for the access to justice for women. Of course, you're going to use whatever your own variables are. I'm going to see if run all works a little better for me. Run all worked better for me, so my answers popped up down here. Here's my variance for my first, my X variable. And so I can copy and paste it in, or I can type it, whichever is easier for you. I could use that cat command if you wanted. I'm not doing that because I want just a very... I don't mind having the code block up here, but I don't want it to do the thing where it gives the code block, then gives an answer, then goes back to the code block again. And with that cat command, that's the way that works. I want to actually have all of the typed answers in one place. So then for the minimum and maximum, so for the next two questions, the minimum and maximum, and the first and third quartiles, I'm actually going to create just a single code block, and I'm going to use one command. I'm going to use that summary command because it will give me all of that. I could also have gotten the mean and median this way, but I'm going to... For these things, typically this is where we would get the minimum, the maximum, and those quartiles because we want to look at all of them together. So I'm going to do it that way. So I'm going to run the summary command twice, once with each of my variables, and you can fully type out the variable names. It's not a bad idea to use those arrow keys to actually select it though because R will fill it in and you won't end up with any typos. So that's really useful. I'm going to do the run all command again, and so now I have... So I did these in this order. Participatory Democracy Index is the first line. The second line is the second one. So this is my X. The minimum is 0.0090. I think I put an extra zero in there. I'm going to hit delete a few times to bring my... So that everything stays nice and lined up. The maximum is 0.8120. I'm going to put in the minimum for the access to justice for women. And the maximum. And then I'm going to come down here. I want the first quartile is 0.1680. I want that over a little bit. I'm just being a little bit picky. It would be nice if your answers are a little bit well formatted. They don't have to be perfectly formatted, but try to make it easy for me to find your information. First quartile minus 0.1185. Third quartile 1.7295. At this point, I'm going to save this, and I'm going to render this just to make sure that everything is coming out okay so far. Since I've had a couple of glitches, everything seems to be coming out okay so far. So the last thing is plot a histogram of the X variable and plot a histogram of the Y variable. So I'm going to show you again how to get that help command. So I'm going to pull up the help command for histogram. The command is HIST. The help will come up over here. There's a lot of different stuff. A lot of these things have default values, so you don't have to worry about them. And in fact, I believe I can get away with nothing but typing HIST and then my data frame name, the dollar sign, and then my X variable name. That should give me a really basic histogram, and that's all I'm asking you for at this point. So you'll notice that this label down here is not very nice, and then its frequency. I can change that to count if I want rather than frequency, or I can change that to probability rather than frequency. So there are options. That's actually the probability. The default is frequency, and the other options are... Let's see. Yeah, okay, so yeah, now that's the frequency. So the default is I get the frequency. And the other option is I can get probabilities. So anyway, it came up fine in the sort of test area here. I'm going to come down to number 11, and I'm going to say Control-Alt-I again to create another code block. So remember Control-Alt-I or Command-Option-I. And in this case, I want to do a histogram of my Y variable. So it's in my demonstration data, and I hit the dollar sign. And all I remember is it starts with V2C, but when the whole thing comes up here, I see that ACJSTW that stands for Access to Justice for Women. So I select my Access to Justice for Women variable, and I will do run all again, see if that works. It worked. Wonderful. I'm going to render it now. Wonderful. It rendered. If I come back out here to my files, I can see that I have a file that is named problemsetfordemonstrationproject.html. This file right here is the one that, if I'm working in RStudio, which I am, or if you're working in RStudio, I can go right to Canvas, go to the Submission Place, open it up, browse, drill down to this folder, find this file, and upload it, and I'm done. If I am working in Posit Cloud, I have one more step, which is to checkmark this, come over here to the More section, and in this area, there's going to be an Export option. Since I'm working in RStudio, it's not there, but I'll use that export to download, and I have a short video for you that shows how to do that. So if you're working in Posit Cloud, go look at that video. But that's it. Problemsetfor is done, and this is about the first one-third of what you're going to have to do for your project as far as stuff that you'll need to do in R. The things that are left, I'm finding a couple of more variables, doing some kind of a hypothesis test, and then running an OLS regression on your two variables and plotting that out. So this is about a third of the work that you'll have to do in R. I'm going to want you to do a little bit of written work to explain and talk about what you've got, what you've found, and about what your idea was. But nothing really extensive. But go ahead and start thinking about that. But if you're able to do this, you are well on your way to having that semester project done. So, all right, thanks, and I'll see you in class.