Join Barton Poulson for an in-depth discussion in this video Comparing means with the t-test, part of Up and Running with R.
- View Offline
One common inferential test is to compare two groups on a single…quantitative outcome.…While there are several ways to do this, the most common is to use a T-test.…In this particular example, we're going to show that this is a very simple thing…to do in R. I'm going to use the google _correlate data that I've used before.…I'm going to load that.…I'm just going to bring up the list of names.…What I'm going to do here, just for fun, is I'm going to look at interest in NBA…as a search term, and see if that differs between states that have NBA basketball…teams, and states that don't.…
So, all I need to do is come down here to line 10.…I'm using the function t.test. That makes sense.…I'm saying what my outcome variable is.…That's NBA; that means as a search term, and then the predictor is whether they have an NBA,…so has_nba is a yes/no variable.…I'm just going to run line 10 here, and maximize this one.…You see here that it's telling me that it's using the Welch Two Sample t-test.…That is something that allows for unequal variants between samples.…
The course continues with examples on how to create charts and plots, check statistical assumptions and the reliability of your data, look for data outliers, and use other data analysis tools. Finally, learn how to get charts and tables out of R and share your results with presentations and web pages.
- What is R?
- Installing R
- Creating bar character for categorical variables
- Building histograms
- Calculating frequencies and descriptives
- Computing new variables
- Creating scatterplots
- Comparing means