Correct_Formula_Order | R Documentation |
Correct_Formula_Order
checks the order of formulas given and corrects any ordering issues, orders alphabetically, by term number, etc.
Correct_Formula_Order(
term_n,
tform,
keep_constant,
a_n,
names,
cons_mat = matrix(c(0)),
cons_vec = c(0),
verbose = FALSE,
model_control = list()
)
term_n |
term numbers for each element of the model |
tform |
list of string function identifiers, used for linear/step |
keep_constant |
binary values to denote which parameters to change |
a_n |
list of initial parameter values, used to determine the number of parameters. May be either a list of vectors or a single vector. |
names |
columns for elements of the model, used to identify data columns |
cons_mat |
Matrix containing coefficients for a system of linear constraints, formatted as matrix |
cons_vec |
Vector containing constants for a system of linear constraints, formatted as vector |
verbose |
integer valued 0-4 controlling what information is printed to the terminal. Each level includes the lower levels. 0: silent, 1: errors printed, 2: warnings printed, 3: notes printed, 4: debug information printed. Errors are situations that stop the regression, warnings are situations that assume default values that the user might not have intended, notes provide information on regression progress, and debug prints out C++ progress and intermediate results. The default level is 2 and True/False is converted to 3/0. |
model_control |
controls which alternative model options are used, see Def_model_control() for options and vignette("Control_Options") for further details |
returns the corrected lists
Other Data Cleaning Functions:
Check_Dupe_Columns()
,
Check_Trunc()
,
Check_Verbose()
,
Convert_Model_Eq()
,
Date_Shift()
,
Def_Control()
,
Def_Control_Guess()
,
Def_model_control()
,
Def_modelform_fix()
,
Event_Count_Gen()
,
Event_Time_Gen()
,
Joint_Multiple_Events()
,
Replace_Missing()
,
Time_Since()
,
factorize()
,
factorize_par()
,
gen_time_dep()
,
interact_them()
library(data.table)
## basic example code reproduced from the starting-description vignette
term_n <- c(0, 1, 1, 0, 0)
tform <- c("loglin", "quad_slope", "lin", "lin_int", "lin_slope")
keep_constant <- c(0, 0, 0, 1, 0)
a_n <- c(1, 2, 3, 4, 5)
names <- c("a", "a", "a", "a", "a")
val <- Correct_Formula_Order(term_n, tform, keep_constant,
a_n, names,
cons_mat = matrix(c(0)),
cons_vec = c(0)
)
term_n <- val$term_n
tform <- val$tform
keep_constant <- val$keep_constant
a_n <- val$a_n
names <- val$names
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.