zdata <- data.frame(y = 1:5, ofreq = c(63, 14, 5, 1, 2))
fit <- vglm(y ~ 1, zipf, data = zdata, trace = TRUE, weight = ofreq, crit = "coef")
fit <- vglm(y ~ 1, zipf(link = identitylink, init = 3.4), data = 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