@@ -39,20 +39,23 @@ model_parameters.selection <- function(model,
3939
4040
4141# ' @export
42- p_value.selection <- function (model , component = c(" all" , " selection" , " outcome" , " auxiliary" ), ... ) {
43- component <- match.arg(component )
42+ p_value.selection <- function (model , component = " all" , ... ) {
43+ component <- insight :: validate_argument(
44+ component ,
45+ c(" all" , " selection" , " outcome" , " auxiliary" )
46+ )
4447 s <- summary(model )
4548 rn <- row.names(s $ estimate )
4649 estimates <- as.data.frame(s $ estimate , row.names = FALSE )
4750 params <- data.frame (
4851 Parameter = rn ,
4952 p = estimates [[4 ]],
50- Component = " auxiliary " ,
53+ Component = " selection " ,
5154 stringsAsFactors = FALSE ,
5255 row.names = NULL
5356 )
54- params $ Component [s $ param $ index $ betaS ] <- " selection "
55- params $ Component [s $ param $ index $ betaO ] <- " outcome"
57+ params $ Component [s $ param $ index $ errTerms ] <- " auxiliary "
58+ params $ Component [s $ param $ index $ outcome ] <- " outcome"
5659
5760 if (component != " all" ) {
5861 params <- params [params $ Component == component , , drop = FALSE ]
@@ -63,20 +66,23 @@ p_value.selection <- function(model, component = c("all", "selection", "outcome"
6366
6467
6568# ' @export
66- standard_error.selection <- function (model , component = c(" all" , " selection" , " outcome" , " auxiliary" ), ... ) {
67- component <- match.arg(component )
69+ standard_error.selection <- function (model , component = " all" , ... ) {
70+ component <- insight :: validate_argument(
71+ component ,
72+ c(" all" , " selection" , " outcome" , " auxiliary" )
73+ )
6874 s <- summary(model )
6975 rn <- row.names(s $ estimate )
7076 estimates <- as.data.frame(s $ estimate , row.names = FALSE )
7177 params <- data.frame (
7278 Parameter = rn ,
7379 SE = estimates [[2 ]],
74- Component = " auxiliary " ,
80+ Component = " selection " ,
7581 stringsAsFactors = FALSE ,
7682 row.names = NULL
7783 )
78- params $ Component [s $ param $ index $ betaS ] <- " selection "
79- params $ Component [s $ param $ index $ betaO ] <- " outcome"
84+ params $ Component [s $ param $ index $ errTerms ] <- " auxiliary "
85+ params $ Component [s $ param $ index $ outcome ] <- " outcome"
8086
8187 if (component != " all" ) {
8288 params <- params [params $ Component == component , , drop = FALSE ]
@@ -89,9 +95,12 @@ standard_error.selection <- function(model, component = c("all", "selection", "o
8995# ' @export
9096simulate_model.selection <- function (model ,
9197 iterations = 1000 ,
92- component = c( " all" , " selection " , " outcome " , " auxiliary " ) ,
98+ component = " all" ,
9399 ... ) {
94- component <- match.arg(component )
100+ component <- insight :: validate_argument(
101+ component ,
102+ c(" all" , " selection" , " outcome" , " auxiliary" )
103+ )
95104 out <- .simulate_model(model , iterations , component = component , effects = " fixed" , ... )
96105
97106 class(out ) <- c(" parameters_simulate_model" , class(out ))
0 commit comments