zdata = data.frame(y = 1:5, ofreq = c(63, 14, 5, 1, 2))
fit = vglm(y ~ 1, zipf, zdata, trace = TRUE, weight = ofreq, crit = "coef")
fit = vglm(y ~ 1, zipf(link = identity, init = 3.4), zdata,
trace = TRUE, weight = ofreq)
fit@misc$N
(shat = Coef(fit))
with(zdata, weighted.mean(y, ofreq))
fitted(fit, matrix = FALSE)
Run the code above in your browser using DataLab