From the course: R Essential Training Part 2: Modeling Data

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Comparing one mean to a population: One-sample t-test

Comparing one mean to a population: One-sample t-test

From the course: R Essential Training Part 2: Modeling Data

Start my 1-month free trial

Comparing one mean to a population: One-sample t-test

- [Instructor] When you have a single quantitative variable like age or how much time a person has spent on your website, and you want to compare that variable to a single hypothesized value, say a national average, then a one-sample t-test is going to be your test of choice. Fortunately, this is really easy to do in R. To demonstrate this, I'm going to load a few packages including the datasets package, and then I'm going to come down and get a little bit of information about a dataset called quakes. And this is about earthquakes in Fiji, all of which had a value on the Richter Scale, I assume that's what it is, greater than four. And we can get the names of all the variables now they're listed off to the right but I'm going to just do quakes and then names. So here are the ones that we want. The only one I'm going to focus on right now is mag for magnitude. So what I'm going to do is I'm going to take the quakes…

Contents