Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
subcoef.Rd 1.15 KiB
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/subcoef.R
\name{subcoef}
\alias{subcoef}
\title{Title function to split model into different columns for texreg}
\usage{
subcoef(condition, mname)
}
\arguments{
\item{condition}{The stub that is common for all parameters you want to split. For example 'mean'}

\item{mname}{The name of the model you want to split}
}
\value{
a new texreg object with only the selected column (for example the model output with only the mean parameters)
}
\description{
Title function to split model into different columns for texreg
}
\examples{
{
est_model <- readRDS(system.file("extdata", "mixlogitInt_bootstrap.RDS", package = "choiceTools"))
## make full model in one column using texreg
full_model <- quicktexregapollo(est_model, se="normal")
texreg::screenreg(full_model)
## split the model to different columns, e.g. for mean, sd, sample_interactions
splitmodels <- purrr::map(c("mean_","sd_" , paste0("_s",c(2:6))  ) ,subcoef,full_model)
texreg::screenreg(splitmodels)
## the same, but make sure gof statistics are shown only once
texreg::screenreg(c(splitmodels[[1]],remGOF(splitmodels[2:7] ) ) )

}
}