Created
June 8, 2020 22:42
-
-
Save allatambov/dcca9770ef89e5a4d23abed30c75b75d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Titanic data ### | |
# http://campus.lakeforest.edu/frank/FILES/MLFfiles/Bio150/Titanic/TitanicMETA.pdf | |
titan <- read.csv("https://allatambov.github.io/psms/titanic.csv") | |
summary(titan) | |
table(titan$Survived, titan$Pclass) | |
chisq.test(titan$Survived, titan$Pclass) | |
test <- chisq.test(titan$Survived, titan$Pclass) | |
test$observed | |
test$expected | |
test$statistic | |
(test$observed - test$expected)^2 / test$expected | |
sum((test$observed - test$expected)^2 / test$expected) | |
### Chip n Dale data ### | |
chip <- read.csv("https://allatambov.github.io/psms/chip_n_dale_new.csv") | |
table(chip$fav, chip$assoc) | |
chisq.test(chip$fav, chip$assoc) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment