Download the penguin and set up your analysis environment:
Biscoe Dream Torgersen Sum
Adelie 44 56 52 152
Chinstrap 0 68 0 68
Gentoo 124 0 0 124
Sum 168 124 52 344
Biscoe Dream Torgersen Sum
Adelie 44 56 52 152
Chinstrap 0 68 0 68
Gentoo 124 0 0 124
Sum 168 124 52 344
palmtrees <- read_csv("data/palmtrees.csv")
my_palmtree_table <- table(palmtrees$climbing, palmtrees$stem_solitary)
addmargins(my_palmtree_table)
both non-solitary solitary Sum
both 2 5 9 16
climbing 272 1108 428 1808
non-climbing 37 47 274 358
Sum 311 1160 711 2182
both non-solitary solitary Sum
both 2 5 9 16
climbing 272 1108 428 1808
non-climbing 37 47 274 358
Sum 311 1160 711 2182
email <- read_csv("data/email.csv")
my_email_table <- table(email$spam, email$winner)
addmargins(my_email_table)
no yes Sum
0 3510 44 3554
1 347 20 367
Sum 3857 64 3921
no yes Sum
0 3510 44 3554
1 347 20 367
Sum 3857 64 3921
Call:
glm(formula = spam ~ winner, family = binomial, data = email)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.31405 0.05627 -41.121 < 2e-16 ***
winneryes 1.52559 0.27549 5.538 3.06e-08 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 2437.2 on 3920 degrees of freedom
Residual deviance: 2412.7 on 3919 degrees of freedom
AIC: 2416.7
Number of Fisher Scoring iterations: 5
winner effect
winner
no yes
0.0899663 0.3125000
# weights: 12 (6 variable)
initial value 377.922627
iter 10 value 184.355764
iter 20 value 181.998211
final value 181.975950
converged
island effect (probability) for Adelie
island
Biscoe Dream Torgersen
0.2618842 0.4515092 0.9999974
island effect (probability) for Chinstrap
island
Biscoe Dream Torgersen
2.542366e-06 5.484908e-01 8.273478e-08
island effect (probability) for Gentoo
island
Biscoe Dream Torgersen
7.381133e-01 3.638939e-10 2.494737e-06