Closed larmarange closed 6 years ago
I don't know, I can't remember why I did it that way.
Based on survey
source code should probably use 2 * pt(-abs(tvals), df.residual)
Sources: https://github.com/cran/survey/blob/4bc6f900be6c085805e3912c07521c67129487cd/R/surveyrep.R#L1879
https://github.com/cran/survey/blob/4bc6f900be6c085805e3912c07521c67129487cd/R/survey.R#L1408
right
2 * pt(-abs(tvals), df.residual)
is equivalent to (1 - stats::pt(abs(tvals), df.residual)) * 2
When re-reading your code, I am feeling that there is probably a mistake on that line:
https://github.com/carlganz/svrepmisc/blob/8bed9b212f2fe30aeff843f9e49b2cbd8dc26189/R/misc.R#L34
Shouldn't it be:
?