Running examples in ‘konfound-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: konfound
> ### Title: Perform sensitivity analysis on fitted models
> ### Aliases: konfound
> 
> ### ** Examples
> 
> # using lm() for linear models
> m1 <- lm(mpg ~ wt + hp, data = mtcars)
> konfound(m1, wt)
Percent Bias Necessary to Invalidate the Inference:
To invalidate an inference, 66.664% of the estimate would have to be due to bias. This is based on a threshold of -1.293 for statistical significance (alpha = 0.05).
To invalidate an inference, 21 observations would have to be replaced with cases for which the effect is 0.
See Frank et al. (2013) for a description of the method
Citation: Frank, K.A., Maroulis, S., Duong, M., and Kelcey, B. 2013. What would it take to change an inference? Using Rubin's causal model to interpret the robustness of causal inferences. Education, Evaluation and Policy Analysis, 35 437-460.
Impact Threshold for a Confounding Variable:
The minimum impact to invalidate an inference for a null hypothesis of 0 effect is based on a correlation of 0.787 with the outcome and at 0.787 with the predictor of interest (conditioning on observed covariates) based on a threshold of -0.36 for statistical significance (alpha = 0.05).
Correspondingly the impact of an omitted variable (as defined in Frank 2000) must be 0.787 X 0.787 = 0.619 to invalidate an inference for a null hypothesis of 0 effect.
See Frank (2000) for a description of the method
Citation: Frank, K. 2000. Impact of a confounding variable on the inference of a regression coefficient. Sociological Methods and Research, 29 (2), 147-194
For more detailed output, consider setting `to_return` to table
To consider other predictors of interest, consider setting `test_all` to TRUE.
> konfound(m1, wt, test_all = TRUE)
Note that this output is calculated based on the correlation-based approach used in mkonfound()
Warning in data.frame(t = est_eff/std_err, df = (n_obs - n_covariates -  :
  row names were found from a short variable and have been discarded
Warning: `...` is not empty.

We detected these problematic arguments:
* `needs_dots`

These dots only exist to allow future extensions and should be empty.
Did you misspecify an argument?
# A tibble: 2 x 8
  var_name     t    df action     inference   pct_bias_to_change_in…  itcv r_con
  <chr>    <dbl> <dbl> <chr>      <chr>                        <dbl> <dbl> <dbl>
1 wt       -6.13    30 to_invali… reject_null                   53.1 0.609 0.78 
2 hp       -3.56    30 to_invali… reject_null                   35.8 0.3   0.548
> konfound(m1, wt, to_return = "table")
Dependent variable is mpg 
Warning: Unknown or uninitialised column: `itcv`.
Warning: Unknown or uninitialised column: `impact`.
Warning: `...` is not empty.

We detected these problematic arguments:
* `needs_dots`

These dots only exist to allow future extensions and should be empty.
Did you misspecify an argument?
# A tibble: 3 x 7
  term        estimate std.error statistic p.value  itcv impact
  <chr>          <dbl>     <dbl>     <dbl>   <dbl> <dbl>  <dbl>
1 (Intercept)   37.2       1.60      23.3    0     NA    NA    
2 wt            -3.88      0.633     -6.13   0      0.62 NA    
3 hp            -0.032     0.009     -3.52   0.001 NA     0.511
> 
> # using glm() for non-linear models
> if (requireNamespace("forcats")) {
+   d <- forcats::gss_cat
+ 
+   d$married <- ifelse(d$marital == "Married", 1, 0)
+ 
+   m2 <- glm(married ~ age, data = d, family = binomial(link = "logit"))
+   konfound(m2, age)
+ }
Loading required namespace: forcats
Note that for a non-linear model, impact threshold should not be interpreted.
Note that this is only an approximation. For exact results in terms of the number of cases that must be switched from treatment success to treatment failure to invalidate the inference see: https://msu.edu/~kenfrank/non%20linear%20replacement%20treatment.xlsm
Percent Bias Necessary to Invalidate the Inference:
To sustain an inference, 80.978% of the estimate would have to be due to bias. This is based on a threshold of 0.013 for statistical significance (alpha = 0.05).
To sustain an inference, 17334 of the cases with 0 effect would have to be replaced with cases at the threshold of inference.
See Frank et al. (2013) for a description of the method
Citation: Frank, K.A., Maroulis, S., Duong, M., and Kelcey, B. 2013. What would it take to change an inference? Using Rubin's causal model to interpret the robustness of causal inferences. Education, Evaluation and Policy Analysis, 35 437-460.
Impact Threshold for a Confounding Variable:
The minimum impact to invalidate an inference for a null hypothesis of 0 effect is based on a correlation of 5.535 with the outcome and at 5.535 with the predictor of interest (conditioning on observed covariates) based on a threshold of 1.003 for statistical significance (alpha = 0.05).
Correspondingly the impact of an omitted variable (as defined in Frank 2000) must be 5.535 X 5.535 = 30.636 to invalidate an inference for a null hypothesis of 0 effect.
See Frank (2000) for a description of the method
Citation: Frank, K. 2000. Impact of a confounding variable on the inference of a regression coefficient. Sociological Methods and Research, 29 (2), 147-194
NULL
> 
> # using lme4 for mixed effects (or multi-level) models
> if (requireNamespace("lme4")) {
+   library(lme4)
+   m3 <- fm1 <- lme4::lmer(Reaction ~ Days + (1 | Subject), sleepstudy)
+   konfound(m3, Days)
+ }
Loading required namespace: lme4
Loading required package: Matrix
Error: No tidy method for objects of class lmerMod
Execution halted