-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Piotr Chlebicki
committed
May 31, 2024
1 parent
9c41bd1
commit 2fa354c
Showing
3 changed files
with
72 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,22 @@ internal_varMI <- function(svydesign, | |
sigma_hat <- mean((y - y_pred)^2) # family_nonprobsvy$variance(mu = y_pred, y = y) | ||
est_ps <- n_nons / N | ||
var_nonprob <- n_rand / N^2 * (1 - est_ps) / est_ps * sigma_hat | ||
|
||
if (pmm_exact_se) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Kertoo
Member
|
||
var_nonprob <- nn_exact( | ||
pi_ij = pi_ij, | ||
weights_rand = weights_rand, | ||
n_nons = n_nons, | ||
y = y, | ||
X_nons = X_nons, | ||
X_rand = X_rand, | ||
k = k, | ||
# TODO:: add control here | ||
#control = control | ||
N = N | ||
) | ||
} | ||
|
||
} else if (method == "glm") { # TODO add variance for count binary outcome variable control_outcome$method | ||
|
||
beta <- parameters[, 1] | ||
|
@Kertoo shouldn't this be
nn_excact_se
as a new parameter in thecontrolInf()
function?