When I run mr(dat), the warning message goes "summary may be unreliable" and "number of items to replace is not a multiple of replacement length" #607
-
|
The warning message was:
|
Beta Was this translation helpful? Give feedback.
Answered by
remlapmot
Mar 24, 2025
Replies: 1 comment
-
|
Your choice of outcome and/or exposure and/or instruments is clearly not good because you have a regression model with perfect fit, i.e., you are regressing two variables which are very highly correlated, e.g., something like x <- 1:10
y <- 1:10
summary(lm(y ~ x))
#> Warning in summary.lm(lm(y ~ x)): essentially perfect fit: summary may be
#> unreliable
#>
#> Call:
#> lm(formula = y ~ x)
#>
#> Residuals:
#> Min 1Q Median 3Q Max
#> -5.356e-16 -3.618e-17 4.623e-17 1.685e-16 2.057e-16
#>
#> Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 0.000e+00 1.675e-16 0.000e+00 1
#> x 1.000e+00 2.699e-17 3.704e+16 <2e-16 ***
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>
#> Residual standard error: 2.452e-16 on 8 degrees of freedom
#> Multiple R-squared: 1, Adjusted R-squared: 1
#> F-statistic: 1.372e+33 on 1 and 8 DF, p-value: < 2.2e-16Created on 2025-03-24 with reprex v2.1.1 So you need to change your choice of outcome/exposure/instruments. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
remlapmot
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your choice of outcome and/or exposure and/or instruments is clearly not good because you have a regression model with perfect fit, i.e., you are regressing two variables which are very highly correlated, e.g., something like