user702432
user702432

Reputation: 12178

Equivalent of "PROC GLM; FREQ" in glm()?

Does R glm() have any equivalent of the the FREQ switch in PROC GLM of SAS wherebyt each unit of observation is counted N number of times defined by the corresponding FREQ variable?

Upvotes: 0

Views: 547

Answers (1)

IRTFM
IRTFM

Reputation: 263411

If your data is set up properly then the weights parameter given as vector of integers representing frequency weights may succeed. The situation for family="binomial" needs to have the response counts be one column and the weights be the number of occurrences of the other parameter patterns. The relevant two sentences in the help page with slight editing:

"Non-NULL weights can be used to indicate that [ when the elements of weights are positive integers w_i] .... that each response y_i is the mean of w_i unit-weight observations. For a binomial GLM prior weights are used to give the number of trials when the response is the proportion of successes: they would rarely be used for a Poisson GLM."

In the situation of Poisson GLM the population weights might, however, be entered as an offset term.

Upvotes: 1

Related Questions