Description Usage Arguments Examples
Takes in glm output, performs GIM test, returns estimated coefficients, classic standard errors, robust standard errors, rule of thumb for misspecified model, GIM test statistic and p-value.
1 |
out |
: Output from glm function |
full |
: TRUE if you want to perform the full GIM test, FALSE if you want to quickly check if your model is misspecified |
B |
: Number of new datasets to test |
B2 |
: Number of bootstraps for each new dataset |
cluster |
: For clustered data |
time |
: For time series data |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # estimate ols model
# install.packages("Ecdat")
library(Ecdat)
data(Fatality)
# ols modeling traffic fatality rate
ols <- glm(mrall ~ beertax + factor(year), data=Fatality)
# Quick rule of thumb for model misspecification
GIM(ols, full = FALSE)
# Full GIM test for model misspecification
GIM(ols, full = TRUE, B = 30, B2 = 25)
# Quick rule of thumb for model misspecification; data clustered by state
GIM(ols, full = FALSE, cluster = Fatality$state)
# Full GIM test for model misspecification; data clustered by state
GIM(ols, full = TRUE, B = 30, B2 = 25, cluster = Fatality$state)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.