Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between svyglm and weighted glm

Tags:

r

glm

survey

I would like to know what the difference is between using svyglm or a weighted glm.

For example:

M1 = glm(formula = yy ~ age + gender + country , 
         family = binomial(link = "probit"), 
         data = P2013, 
         subset = (P2013$E27>=14 & P2013$E27<=17), 
         weights = P2013$PESOANO)

or define sample design as:

diseño = svydesign(id =~ NUMERO, 
                   strata =~ ESTRATOGEO, 
                   data = p2013, 
                   weights = P2013$PESOANO)

diseño_per_1417 = subset(diseño, (P2013$E27>=14 & P2013$E27<=17))

and then use svyglm:

M2 = svyglm(formula = yy ~ age + gender + country, 
            family = quasibinomial(link = "probit"),
            data = P2013, 
            subset = (stratum=!0), 
            design = diseño_per_1417)

In the case that I use M2 (svyglm). What can I use to compare models like stepwise does for a glm model?

Thanks, Natalia

like image 869
Natuk Avatar asked Oct 21 '22 11:10

Natuk


1 Answers

From help(glm):

Non-NULL weights can be used to indicate that different observations have different dispersions (with the values in weights being inversely proportional to the dispersions); or equivalently, 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.

I don't think that you are looking for those weights. From your example it seems you are dealing with a stratified survey. you should definitely use surveyglm.

like image 92
Florian Oswald Avatar answered Oct 24 '22 10:10

Florian Oswald