inst/snippet/runswins-glm.R

bb <- mlb2004
bb$runmargin = (bb$R - bb$OR) / (bb$G)

# data frame has summarized data for each team, so different syntax here:
glm(cbind(W,L)~runmargin,data=bb,family='binomial') -> glm.bb
###hop:3-9
summary(glm.bb)

Try the fastR package in your browser

Any scripts or data that you put into this service are public.

fastR documentation built on May 1, 2019, 11:18 p.m.