{ "cells": [ { "cell_type": "markdown", "id": "bd2e788b", "metadata": {}, "source": [ "In this tutorial, we are going to see how to test for an association between two continuous variables in R. As we saw in the lectures, we can address this by running an association test using Pearson's correlations. In R, this can be accomplished with the `cor.test` function." ] }, { "cell_type": "markdown", "id": "6d4e7ed1", "metadata": {}, "source": [ "Let's first generate some fake data for this tutorial:" ] }, { "cell_type": "code", "execution_count": 1, "id": "478a29fa", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
x | y | z | |
---|---|---|---|
<dbl> | <dbl> | <dbl> | |
1 | -1.2070657 | -0.301309701 | 0.41452353 |
2 | 0.2774292 | -0.030464668 | -0.47471847 |
3 | 1.0844412 | -0.002444845 | 0.06599349 |
4 | -2.3456977 | -0.336065971 | -0.50247778 |
5 | 0.4291247 | 0.026681517 | -0.82599859 |
6 | 0.5060559 | 0.106911171 | 0.16698928 |