library(tidyverse)
package 㤼㸱tidyverse㤼㸲 was built under R version 4.0.5replacing previous import 㤼㸱lifecycle::last_warnings㤼㸲 by 㤼㸱rlang::last_warnings㤼㸲 when loading 㤼㸱pillar㤼㸲Registered S3 methods overwritten by 'dbplyr':
  method         from
  print.tbl_lazy     
  print.tbl_sql      
replacing previous import 㤼㸱lifecycle::last_warnings㤼㸲 by 㤼㸱rlang::last_warnings㤼㸲 when loading 㤼㸱hms㤼㸲-- Attaching packages ------------------------------------------------------------ tidyverse 1.3.1 --
v ggplot2 3.3.5     v purrr   0.3.4
v tibble  3.1.6     v dplyr   1.0.7
v tidyr   1.1.4     v stringr 1.4.0
v readr   2.1.1     v forcats 0.5.1
package 㤼㸱ggplot2㤼㸲 was built under R version 4.0.5package 㤼㸱tibble㤼㸲 was built under R version 4.0.5package 㤼㸱tidyr㤼㸲 was built under R version 4.0.5package 㤼㸱readr㤼㸲 was built under R version 4.0.5package 㤼㸱purrr㤼㸲 was built under R version 4.0.5package 㤼㸱dplyr㤼㸲 was built under R version 4.0.5package 㤼㸱stringr㤼㸲 was built under R version 4.0.5package 㤼㸱forcats㤼㸲 was built under R version 4.0.5-- Conflicts --------------------------------------------------------------- tidyverse_conflicts() --
x dplyr::filter() masks stats::filter()
x dplyr::lag()    masks stats::lag()
library(readxl)

This notebook is going to be used to run a chi squared analysis on my survey results. Specifically looking at if higher education leads to higher scores of life satisfaction.

This chunk reads the survey data from Excel into RStudio.

survey.results <- read_excel("Survey_Results.xlsx")

This chunk then displays the data with each individual category and the responses recorded.

survey.results

The following chunk then runs a data analysis on the responses using a chi squared test. Specifically, analyzing the scores for each education category.The ultimate analysis being done in this step is to verify if there is a stastical significance between the level of education one has and their overall life satisfaction.

table(survey.results$Education, survey.results$Score)
                                                       
                                                        20 28 29 31 32 33 34 35 36 37 38 40 41 44 49
  Associate Degree                                       0  0  0  0  0  0  0  0  1  0  0  0  0  1  0
  Bachelor's Degree                                      0  1  1  1  0  1  1  1  2  1  2  0  0  0  0
  High school graduate, diploma or the equivalent (GED)  1  1  0  1  3  1  1  1  2  3  1  0  1  0  0
  Master's Degree                                        0  0  0  0  0  0  0  0  0  0  0  1  0  0  0
  Some college credit, no degree                         0  1  0  0  0  1  1  1  1  1  1  0  0  0  1
  Trade/technical/vocational training                    0  0  0  0  0  0  0  0  0  0  0  0  0  1  0
chisq.test(survey.results$Education, survey.results$Score)
Chi-squared approximation may be incorrect

    Pearson's Chi-squared test

data:  survey.results$Education and survey.results$Score
X-squared = 86.823, df = 70, p-value = 0.08426

There was not a statistically significant relationship between Education and Final Score, chi-square(70) = 86.82, p = .08.

LS0tDQp0aXRsZTogIlIgTm90ZWJvb2siDQpvdXRwdXQ6IGh0bWxfbm90ZWJvb2sNCi0tLQ0KDQpgYGB7cn0NCmxpYnJhcnkodGlkeXZlcnNlKQ0KbGlicmFyeShyZWFkeGwpDQpgYGANCg0KVGhpcyBub3RlYm9vayBpcyBnb2luZyB0byBiZSB1c2VkIHRvIHJ1biBhIGNoaSBzcXVhcmVkIGFuYWx5c2lzIG9uIG15IHN1cnZleSByZXN1bHRzLiBTcGVjaWZpY2FsbHkgbG9va2luZyBhdCBpZiBoaWdoZXIgZWR1Y2F0aW9uIGxlYWRzIHRvIGhpZ2hlciBzY29yZXMgb2YgbGlmZSBzYXRpc2ZhY3Rpb24uDQoNClRoaXMgY2h1bmsgcmVhZHMgdGhlIHN1cnZleSBkYXRhIGZyb20gRXhjZWwgaW50byBSU3R1ZGlvLg0KYGBge3J9DQpzdXJ2ZXkucmVzdWx0cyA8LSByZWFkX2V4Y2VsKCJTdXJ2ZXlfUmVzdWx0cy54bHN4IikNCmBgYA0KDQpUaGlzIGNodW5rIHRoZW4gZGlzcGxheXMgdGhlIGRhdGEgd2l0aCBlYWNoIGluZGl2aWR1YWwgY2F0ZWdvcnkgYW5kIHRoZSByZXNwb25zZXMgcmVjb3JkZWQuDQpgYGB7cn0NCnN1cnZleS5yZXN1bHRzDQpgYGANClRoZSBmb2xsb3dpbm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