R/addTableStep.R

Defines functions addTableStep

##' @keywords internal
## Used internally to add info to tables generated by NMreadPhi and NMreadExt.
## Do not export

addTableStep <- function(dt,keep.table.name=FALSE){

    table.name <- NULL
    table.step <- NULL

    dt[,table.step:="Unknown"]
    dt[grepl("First Order",table.name),table.step:="FO"]
    dt[grepl("First Order Conditional Estimation",table.name),table.step:="FOCE"]
    dt[grepl("First Order Conditional Estimation with Interaction",table.name),table.step:="FOCEI"]

    dt[grepl("Stochastic Approximation Expectation-Maximization",table.name),table.step:="SAEM"]

    dt[grepl("Importance Sampling",table.name),table.step:="IMP"]
    dt[grepl("Importance/MAP Sampling",table.name),table.step:="IMP"]

    dt[grepl("Laplacian Conditional Estimation",table.name),table.step:="LAPLACECE"]
    
    if(!keep.table.name){
        dt[,table.name:=NULL]
    }

    dt[]
}

Try the NMdata package in your browser

Any scripts or data that you put into this service are public.

NMdata documentation built on April 4, 2025, 2:11 a.m.