---
# System prepended metadata

title: stat526 final project - glm goodness of fit

---

# stat526 final project - glm goodness of fit 

[toc]


## To do 
- [ ] ~~a review on the existing libraries~~
- [ ] ~~a report on what functions we would like to implement for improvements~~
- [x] talk with Professor Zhang
- [ ] read and summarize the 3 papers



## a review on the existing libraries
- what models
    - which methods (which library)


- general glm
    - deviance test (*?*)



- logistic regression
    - Hosmer Lemeshow Goodness of Fit  ([*ResourceSelection*](https://cran.r-project.org/web/packages/ResourceSelection/ResourceSelection.pdf) or *MKmisc*)
    - Pseudo R^2 (*pscl*)
    - deviance test (*?*)

## GOF Libraries
- https://cran.r-project.org/web/packages/ResourceSelection/ResourceSelection.pdf (Hosmer-Lemeshow Goodness of Fit)

- https://cran.r-project.org/web/packages/DistributionTest/index.html (Anderson-Darling statistic, Cramer-von Mises statistic (distribution test), Kolmogorov-Smirnov statistic)

- https://cran.r-project.org/web/packages/ehaGoF/ehaGoF.pdf  (numerous GOF tests such as AIC, adjusted R-squared, etc.) 
    - [name=daniel] This is GOF for lm not glm.

- https://cran.r-project.org/web/packages/sizeMat/sizeMat.pdf (Nagelkerke R square)

- https://cran.r-project.org/web/packages/GofKmt/GofKmt.pdf (Khmaladze Martingale Transformation) (Logistic Regression)

- https://cran.r-project.org/web/packages/GRPtests/GRPtests.pdf (Goodness-of-Fit Tests in High-Dimensional GLMs)

## Papers to read
- Lipsitz SR, Fitzmaurice GM, Molenberghs G. Goodness-of-Fit Tests for Ordinal Response Regression Models. Journal of the Royal Statistical Society 1996;45(2):175-190
    - https://www-jstor-org.ezproxy.lib.purdue.edu/stable/pdf/2986153.pdf?refreqid=excelsior%3A3ba20084b80855a41fce5610461dc549
    - [name=Yi-Hui] I will read this

- Pulkstenis E, Robinson TJ. Goodness-of-fit tests for ordinal response regression models. Statistics in Medicine 2004;23:999-1014.
    - [name=Cheng-Hao] I will read this
    - https://onlinelibrary-wiley-com.ezproxy.lib.purdue.edu/doi/pdfdirect/10.1002/sim.1659

- A comparison of goodness-of-fit tests for the logistic regression model. David W. Hosmer, Trina Hosmer
    - [name=daniel] I will read this
## Presentation Outline
summarize the 3 papers. It could be divided into 2 parts: GOF for ordinal response models and GOF for logistic models.

For the first part, Lipsitz SR test and Pulkstenis E test could be discussed, and for the second part, several tests from the third paper could be brought up. 

The way to introduce a test can go like this:
1, backgrounds of the test, why it was invented, what problems it tries to solve. 
2, how the test is conducted, what’s the test statistic
3, comparisons. what tests are preferred over the others given different situations.
4, package implemntation



## implementation 
github link 








