## Population Income Illiteracy Life Exp Murder HS Grad Frost Area
## Alabama 3615 3624 2.1 69.05 15.1 41.3 20 50708
## Alaska 365 6315 1.5 69.31 11.3 66.7 152 566432
## Arizona 2212 4530 1.8 70.55 7.8 58.1 15 113417
## Arkansas 2110 3378 1.9 70.66 10.1 39.9 65 51945
## California 21198 5114 1.1 71.71 10.3 62.6 20 156361
## Colorado 2541 4884 0.7 72.06 6.8 63.9 166 103766
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
## ✔ ggplot2 3.4.0 ✔ purrr 1.0.1
## ✔ tibble 3.1.8 ✔ dplyr 1.1.0
## ✔ tidyr 1.3.0 ✔ stringr 1.5.0
## ✔ readr 2.1.4 ✔ forcats 1.0.0
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
##
## Attaching package: 'psych'
##
##
## The following objects are masked from 'package:ggplot2':
##
## %+%, alpha
## vars n mean sd median trimmed mad min
## Population 1 50 4246.42 4464.49 2838.50 3384.28 2890.33 365.00
## Income 2 50 4435.80 614.47 4519.00 4430.08 581.18 3098.00
## Illiteracy 3 50 1.17 0.61 0.95 1.10 0.52 0.50
## Life Exp 4 50 70.88 1.34 70.67 70.92 1.54 67.96
## Murder 5 50 7.38 3.69 6.85 7.30 5.19 1.40
## HS Grad 6 50 53.11 8.08 53.25 53.34 8.60 37.80
## Frost 7 50 104.46 51.98 114.50 106.80 53.37 0.00
## Area 8 50 70735.88 85327.30 54277.00 56575.72 35144.29 1049.00
## max range skew kurtosis se
## Population 21198.0 20833.00 1.92 3.75 631.37
## Income 6315.0 3217.00 0.20 0.24 86.90
## Illiteracy 2.8 2.30 0.82 -0.47 0.09
## Life Exp 73.6 5.64 -0.15 -0.67 0.19
## Murder 15.1 13.70 0.13 -1.21 0.52
## HS Grad 67.3 29.50 -0.32 -0.88 1.14
## Frost 188.0 188.00 -0.37 -0.94 7.35
## Area 566432.0 565383.00 4.10 20.39 12067.10
I’ll examine the relationship between income, education level, and life expectancy. In this case, life expectancy would be the dependent variable, income and education level would be the independent variables.
## [1] "double"
## [1] "matrix" "array"
## # A tibble: 3 × 4
## term estimate std.error p.value
## <chr> <dbl> <dbl> <dbl>
## 1 (Intercept) 65.9 1.24 1.05e-43
## 2 Income -0.0000734 0.000330 8.25e- 1
## 3 `HS Grad` 0.100 0.0251 2.28e- 4
## [1] 0.3396703
## Alabama Alaska Arizona Arkansas California Colorado Connecticut
## int 1.00 1.00 1.00 1.00 1.00 1.00 1.00
## Population 3615.00 365.00 2212.00 2110.00 21198.00 2541.00 3100.00
## Income 3624.00 6315.00 4530.00 3378.00 5114.00 4884.00 5348.00
## Illiteracy 2.10 1.50 1.80 1.90 1.10 0.70 1.10
## Life Exp 69.05 69.31 70.55 70.66 71.71 72.06 72.48
## Murder 15.10 11.30 7.80 10.10 10.30 6.80 3.10
## HS Grad 41.30 66.70 58.10 39.90 62.60 63.90 56.00
## Frost 20.00 152.00 15.00 65.00 20.00 166.00 139.00
## Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa
## int 1.00 1.00 1.00 1.0 1.00 1.00 1.00 1.00
## Population 579.00 8277.00 4931.00 868.0 813.00 11197.00 5313.00 2861.00
## Income 4809.00 4815.00 4091.00 4963.0 4119.00 5107.00 4458.00 4628.00
## Illiteracy 0.90 1.30 2.00 1.9 0.60 0.90 0.70 0.50
## Life Exp 70.06 70.66 68.54 73.6 71.87 70.14 70.88 72.56
## Murder 6.20 10.70 13.90 6.2 5.30 10.30 7.10 2.30
## HS Grad 54.60 52.60 40.60 61.9 59.50 52.60 52.90 59.00
## Frost 103.00 11.00 60.00 0.0 126.00 127.00 122.00 140.00
## Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan
## int 1.00 1.0 1.00 1.00 1.00 1.00 1.00
## Population 2280.00 3387.0 3806.00 1058.00 4122.00 5814.00 9111.00
## Income 4669.00 3712.0 3545.00 3694.00 5299.00 4755.00 4751.00
## Illiteracy 0.60 1.6 2.80 0.70 0.90 1.10 0.90
## Life Exp 72.58 70.1 68.76 70.39 70.22 71.83 70.63
## Murder 4.50 10.6 13.20 2.70 8.50 3.30 11.10
## HS Grad 59.90 38.5 42.20 54.70 52.30 58.50 52.80
## Frost 114.00 95.0 12.00 161.00 101.00 103.00 125.00
## Minnesota Mississippi Missouri Montana Nebraska Nevada
## int 1.00 1.00 1.00 1.00 1.0 1.00
## Population 3921.00 2341.00 4767.00 746.00 1544.0 590.00
## Income 4675.00 3098.00 4254.00 4347.00 4508.0 5149.00
## Illiteracy 0.60 2.40 0.80 0.60 0.6 0.50
## Life Exp 72.96 68.09 70.69 70.56 72.6 69.03
## Murder 2.30 12.50 9.30 5.00 2.9 11.50
## HS Grad 57.60 41.00 48.80 59.20 59.3 65.20
## Frost 160.00 50.00 108.00 155.00 139.0 188.00
## New Hampshire New Jersey New Mexico New York North Carolina
## int 1.00 1.00 1.00 1.00 1.00
## Population 812.00 7333.00 1144.00 18076.00 5441.00
## Income 4281.00 5237.00 3601.00 4903.00 3875.00
## Illiteracy 0.70 1.10 2.20 1.40 1.80
## Life Exp 71.23 70.93 70.32 70.55 69.21
## Murder 3.30 5.20 9.70 10.90 11.10
## HS Grad 57.60 52.50 55.20 52.70 38.50
## Frost 174.00 115.00 120.00 82.00 80.00
## North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island
## int 1.00 1.00 1.00 1.00 1.00 1.0
## Population 637.00 10735.00 2715.00 2284.00 11860.00 931.0
## Income 5087.00 4561.00 3983.00 4660.00 4449.00 4558.0
## Illiteracy 0.80 0.80 1.10 0.60 1.00 1.3
## Life Exp 72.78 70.82 71.42 72.13 70.43 71.9
## Murder 1.40 7.40 6.40 4.20 6.10 2.4
## HS Grad 50.30 53.20 51.60 60.00 50.20 46.4
## Frost 186.00 124.00 82.00 44.00 126.00 127.0
## South Carolina South Dakota Tennessee Texas Utah Vermont
## int 1.00 1.00 1.00 1.0 1.0 1.00
## Population 2816.00 681.00 4173.00 12237.0 1203.0 472.00
## Income 3635.00 4167.00 3821.00 4188.0 4022.0 3907.00
## Illiteracy 2.30 0.50 1.70 2.2 0.6 0.60
## Life Exp 67.96 72.08 70.11 70.9 72.9 71.64
## Murder 11.60 1.70 11.00 12.2 4.5 5.50
## HS Grad 37.80 53.30 41.80 47.4 67.3 57.10
## Frost 65.00 172.00 70.00 35.0 137.0 168.00
## Virginia Washington West Virginia Wisconsin Wyoming
## int 1.00 1.00 1.00 1.00 1.00
## Population 4981.00 3559.00 1799.00 4589.00 376.00
## Income 4701.00 4864.00 3617.00 4468.00 4566.00
## Illiteracy 1.40 0.60 1.40 0.70 0.60
## Life Exp 70.08 71.72 69.48 72.48 70.29
## Murder 9.50 4.30 6.70 3.00 6.90
## HS Grad 47.80 63.50 41.60 54.50 62.90
## Frost 85.00 32.00 100.00 149.00 173.00
## [,1]
## int 0
## Population 0
## Income 0
## Illiteracy 0
## Life Exp 1
## Murder 0
## HS Grad 0
## Frost 0
## our.results lm.results
## int 0 70.94
## Population 0 0.00
## Income 0 0.00
## Illiteracy 0 0.03
## Life Exp 1 -0.30
## Murder 0 0.05
## HS Grad 0 -0.01
## Frost 0 0.00