Tip:
Highlight text to annotate it
X
Hello. Today I’m going to introduce you to a statistical software called R
and a script that you can use to calculate probabilities automatically
and display a nice plot for them.
R is a statistical software package similar to SPSS.
The main difference being that while SPSS is all menu and dialogue box driven,
R is all command driven. You can type in everything you want to do.
It makes it more powerful, but also much more complicated to use.
R is free, open source software,
which means you can install it on any computer you want for free.
You can install it on your own computer if you'd like to,
or all campus computers should also have it available.
So I’ve opened up the main window here.
If you’re on Windows, it will look slightly different,
but the basic setup is similar enough that I think you can figure it out from here.
You’ll see that I have a bunch of introductory text,
some information about R, and then down here is a little right arrow,
and you’ll notice the flashing cursor so I can type there.
Okay.
So you’re going to type your commands here when we get to it.
You’ll notice that I downloaded the probability script here to the desktop the R.data file.
If I just double click it, it says load and it gives me the file.
And now I can use it.
On Windows, I believe it doesn’t say load, but it still loads it in.
If for some reason double clicking doesn’t work,
you can always just do File, Open Document or Source File,
either one of these will work, and choose the file.
So now we have it loaded.
We’re going to type prob, for probability,
left parenthesis, right parenthesis, and hit Return.
And we have some nice prompts.
So the point of the script is you have calculated the Z statistic
and you want to get the probability for it. Okay.
So let’s say in my example here I want to find the probability that Z is greater than 2.
Okay. So I look at the forms here, less than, greater than, in between, or on either tail.
And just remember that less than is equivalent
to less than or equal to and vice versa for greater than.
So I want it greater than 2, so I’m going to choose option 2.
The value from the lower bound C is 2 again
because I want probability to use greater than 2.
Okay. And you’ll notice it plots it here.
The slight bug on, on R for Mac the window looks a little weird.
You have to resize it. You can see here we have our nice normal curve.
The probability area is shaded here very nicely.
And the probability of Z is equal to or greater than 2 is equal to .0228. Okay.
And if you want to save this plot,
you’ll notice you’ll have a option here do you want to save this plot to your desktop.
Well I’m very proud of my plot there, so I’m going to go ahead and save that.
And you’ll notice it appears right here on my desktop.
And you can do this again and again if you have multiple ones you need.
You can also choose N if you don’t want to save it.
And finally at any point you would type q to quit, and then you’re done.
Hope this helps.