Generalized Linear Models in R
Richard Erickson
Instructor
Expected probability
Example of flipping 1 coin
Expected probability
Flipping 4 coins at once
rbinom(n = , size = , p = )
n
: Number of random numbers to generatesize
: Number of trialsp
: Probability of "success"size = 1
: BernoulliLong format (Bernoulli format)
y = c(0,1,...)
Wide format (Binomial format)
cbind(success, failure)
y = c(0.3, 0.1,...)
with weights = c(1, 3, 2...)
Long data:
response treatment length
dead a 3.471006
dead a 3.704329
alive a 2.043244
alive b 1.667343
Wide data:
group dead alive Total groupTemp
a 12 2 14 high
b 3 11 14 low
Generalized Linear Models in R