Skip to content

Error in get_prm() when SAEM is the estimation method #196

@AndreasCalvagone

Description

@AndreasCalvagone

Hello, I was getting the following error when trying to produce a parameter table from an SAEM model:

get_prm(xp,show_all = T,transform = FALSE)
Returning parameter estimates from $prob no.1, subprob no.0, method saem
Error in if (n_theta != length(theta_names)) { : 
  missing value where TRUE/FALSE needed
In addition: Warning messages:
1: Unknown columns: `OBJ` 
2: Unknown columns: `OBJ` 
3: Unknown columns: `OBJ` 

The issue is that when using SAEM the the last column of the .ext file is called SAEMOBJ. This column is not excluded in the get_iter() function. I could simply patch this bug by correcting get_iter():

grab_iter <-
function (ext, iter) 
{
    out <- ext %>% dplyr::filter(.$ITERATION == iter) %>% dplyr::select(-dplyr::one_of("ITERATION", 
        "OBJ","SAEMOBJ"))  # added SAEMOBJ here
    if (nrow(out) == 0) 
        out[1, ] <- NA_real_
    purrr::flatten(out)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions