Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to report goodness of fit for a svyglm object?

Tags:

r

survey

a question about the survey package in R. I know this is very basic but I've found nothing. So:

library(survey)
data(api)
dclus2 <- svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc)
summary(svyglm(api00 ~ ell + meals + mobility, design = dclus2))
Call:
svyglm(formula = api00 ~ ell + meals + mobility, design = dclus2)

Survey design:
svydesign(id = ~dnum, weights = ~pw, data = apiclus1, fpc = ~fpc)

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept) 819.2791    21.3900  38.302 4.65e-13 ***
ell          -0.5167     0.3240  -1.595    0.139    
meals        -3.1232     0.2781 -11.231 2.29e-07 ***
mobility     -0.1689     0.4449  -0.380    0.711    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for gaussian family taken to be 3157.85)

Number of Fisher Scoring iterations: 2

Is there anything like an R-squared or any other statistic that would give a reader an impression of how good the model fits the data?

thanks.

like image 394
Florian Oswald Avatar asked Nov 13 '22 05:11

Florian Oswald


1 Answers

There is a package that came out in late 2016 that I found called "poliscidata" that has a function fit.svyglm that returns R square and Adj. R Square outputs for svyglm objects. I have used it with success.

like image 65
Courtney B. Avatar answered Nov 15 '22 06:11

Courtney B.