[R] goodness of fit for logistic regression with survey package

haps halptekin at gmail.com
Fri Oct 12 23:02:42 CEST 2012


I am making exploratory analyses on a complex survey data by using survey
package. Could you help me how to see the goodness of fit for the model
below? Should I use AIC, BIC, ROC, or what? What code would let me run a
goodness of fit test for the model? Here are my codes:

#incorporating design effects#
> mydesign <- svydesign(id=~clust, strata=~strat, weights=~sweight,
> data=mydata)
#logistic regression model#
> model1 <- svyglm(y ~ x1 + x2+ x3 + x4 + x5, design = mydesign,
> data=(mydata),family=quasibinomial())
#I tried loglik function, but didn't work#
> logLik(model1)
[1] 8753.057
Warning message:
In logLik.svyglm(model1) : svyglm not fitted by maximum likelihood.
#I did the following which didn't work either#
> with(model1, null.deviance - deviance)
[1] 1039.695
> with(model2, df.null - df.residual)
[1] 6565
> with(model2, pchisq(null.deviance - deviance, df.null - df.residual,
+                      lower.tail = FALSE))
[1] 1






--
View this message in context: http://r.789695.n4.nabble.com/goodness-of-fit-for-logistic-regression-with-survey-package-tp4646044.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list