To obtain a weak instrument test for instrument variables in modelsummary using R, you can use the "summary_iv()" function from the "ivmodel" package. This function calculates the Sargan-Hansen test for weak instrument validity.
Here's an example code:
```{r} library(ivmodel)
iv_model <- ivreg(y ~ x | z1 + z2, data = data)
summaryiv(ivmodel) ```
The output will show you the Sargan-Hansen test statistic and its associated p-value. If the p-value is less than your chosen significance level (e.g. 0.05), then you can reject the null hypothesis of no weak instrument problem. If the p-value is greater than your chosen significance level, you cannot reject the null hypothesis and there is no evidence of a weak instrument problem.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2021-05-20 11:00:00 +0000
Seen: 12 times
Last updated: Dec 19 '21
What does the error message "1 timer(s) still in the queue" indicate in an Angular/Karma unit test?
What is the method to simulate the NestJS internal Logger using Jest?
Is it possible to undo ActiveRecord transactions in Rails testing without causing an error to occur?
Is it possible for Statsmodel's pairwise Tukey's test to produce a p-value that is negative?
What is the process for verifying the handling of command line arguments in arguments?
How can unit testing be done with Firebase and Flutter?
What is the procedure for testing scheduling in Laravel?
What is the method to simulate navigator.geolocation in a React Jest Test?
How can I turn off the automatic running of Jest test runner within the Visual Studio Code editor?