@@ -13,7 +13,14 @@ predictors; a missing `preproc` will lead to a warning.
1313## Usage
1414
1515``` r
16- ei_test_car(spec , weights , iter = 1000 , use_chisq = FALSE )
16+ ei_test_car(
17+ spec ,
18+ weights ,
19+ iter = 1000 ,
20+ undersmooth = 1.5 ,
21+ use_chisq = nrow(spec ) > = 2000 ,
22+ use_hc = FALSE
23+ )
1724```
1825
1926## Arguments
@@ -40,7 +47,15 @@ ei_test_car(spec, weights, iter = 1000, use_chisq = FALSE)
4047- iter:
4148
4249 The number of permutations to use when estimating the null
43- distribution. Ignored when ` use_chisq = TRUE ` .
50+ distribution, including the original identity permutation. Ignored
51+ when ` use_chisq = TRUE ` .
52+
53+ - undersmooth:
54+
55+ A value to divide the estimated ridge penalty by when partialling out
56+ the partially linear component of the model. A larger value will
57+ smooth the partially linear component less, which may improve Type I
58+ error control in finite samples at the cost of power.
4459
4560- use_chisq:
4661
@@ -49,6 +64,12 @@ ei_test_car(spec, weights, iter = 1000, use_chisq = FALSE)
4964 appropriate for larger sample sizes (Helwig 2022 recommends at least
5065 200 when a single predictor is used).
5166
67+ - use_hc:
68+
69+ If ` TRUE ` , use a heteroskedasticity-consistent covariance estimate.
70+ More computationally intensive, but may make a difference in small
71+ samples or when there is substantial heteroskedasticity.
72+
5273## Value
5374
5475A tibble with one row per outcome variable and columns describing the
@@ -62,9 +83,9 @@ The test is a Kennedy-Cade (1996) style permutation test on a Wald
6283statistic for the coefficients not included in the "reduced" model that
6384would be fit by
6485[ ` ei_ridge() ` ] ( https://corymccartan.com/seine/reference/ei_ridge.md ) .
65- The test is carried out by fitting a regression on a fully
66- basis-expanded combination of covariates and predictors, and calculating
67- a Wald statistic for the
86+ The test statistic is asymptotically chi-squared under the null and may
87+ be anti-conservative in small samples, especially when the
88+ dimensionality of the basis expansion is large.
6889
6990## References
7091
@@ -100,12 +121,12 @@ spec = ei_spec(
100121 preproc = preproc
101122)
102123
103- ei_test_car(spec , iter = 19 ) # use a larger number in practice
124+ ei_test_car(spec , iter = 20 ) # use a larger number in practice
104125# > # A tibble: 4 × 4
105126# > outcome W df p.value
106127# > <chr> <dbl> <int> <dbl>
107- # > 1 pres_dem_hum 300 . 105 0.05
108- # > 2 pres_rep_nix 257 . 105 0.05
109- # > 3 pres_ind_wal 357 . 105 0.05
110- # > 4 pres_abs 206 . 105 0.05
128+ # > 1 pres_dem_hum 296 . 105 0.05
129+ # > 2 pres_rep_nix 254 . 105 0.05
130+ # > 3 pres_ind_wal 353 . 105 0.05
131+ # > 4 pres_abs 210 . 105 0.05
111132```
0 commit comments