R/addTableStep.R

Defines functions addTableStep

## 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"]

    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 Nov. 11, 2023, 5:07 p.m.