Skip to content

Commit

Permalink
Add the option to return glmer results in post-selection estimation
Browse files Browse the repository at this point in the history
  • Loading branch information
fenguoerbian committed Sep 11, 2024
1 parent 2cdf138 commit 3698687
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,8 @@ Replace_Fixef_NA <- function(in_model){
Logistic_FARMM_Path_Further_Improve <- function(x_mat, y_vec, rand_eff_df, h, k_n, p,
delta_vec_init, eta_stack_init, mu1_vec_init, mu2, a = 1, lam = 0.1,
weight_vec = 1, logit_weight_vec = 1, weight_already_combine = FALSE,
tol = 10^(-5), max_iter = 1000, fast_glm = TRUE){
tol = 10^(-5), max_iter = 1000, fast_glm = TRUE,
return_lmermod = FALSE){
# Post selection estimation to further improve the estimation from a solution path
# Args: x_mat
# y_vec
Expand Down Expand Up @@ -1333,6 +1334,11 @@ Logistic_FARMM_Path_Further_Improve <- function(x_mat, y_vec, rand_eff_df, h, k_
converge = converge,
rand_eff_std = rand_eff_std,
rand_eff_est = rand_eff_est)

if(return_lmermod){
res$glmfit = glmfit
}

return(res)
}

Expand Down

0 comments on commit 3698687

Please sign in to comment.