GIM: GIM

Description Usage Arguments Examples

Description

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.

Usage

1
GIM(out, full = TRUE, B, B2, cluster = NA, time = NA)

Arguments

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

Examples

 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)

IQSS/RobustSE documentation built on May 7, 2019, 6:02 a.m.