View source: R/glm_model_explore.R
glm_model_explore | R Documentation |
Exploratory analyses for linear regression models with multiple response, predictor, and two-way interaction variables. (lm
models).
At the moment, multi-categorical variables are not supported as predictors or interactions (but control is fine). Binary variable should be numeric
instead of factor
glm_model_explore(
data,
response_variable,
predictor_variable,
family,
two_way_interaction_variable = NULL,
three_way_interaction_variable = NULL,
control_variable = NULL,
marginal_alpha = 0.1,
verbose = TRUE,
show_p = TRUE,
return_result = FALSE,
print_control = FALSE,
plot_interaction = FALSE,
file_dir = NULL,
device = "jpeg",
width = 8.5,
height = 5,
units = "in",
y_lim = c(0, 1)
)
data |
|
response_variable |
Response variable. Support |
predictor_variable |
Pred variable. Support |
family |
a GLM family. It will passed to the family argument in glm See |
two_way_interaction_variable |
Two-way interaction variable. Each two-way interaction variable will interact with each pred variable. Support |
three_way_interaction_variable |
Three-way interaction variable. Each three-way interaction variable will interact with each pred and two-way interaction variables. Support |
control_variable |
Control variables. Support |
marginal_alpha |
Set marginal_alpha level for marginally significant (denoted by |
verbose |
Default is |
show_p |
Default is |
return_result |
Default is |
print_control |
Default is |
plot_interaction |
Default is |
file_dir |
Path of the directory to save plot to |
device |
Default is "jpeg". See ggplot2::ggsave() for all options. |
width |
Default is 8.5 (i.e., letter size width). |
height |
Default is 5. |
units |
Default is inches. Options are "in", "cm", "mm" or "px". |
y_lim |
the plot's upper and lower limit for the y-axis. Length of 2. Example: |
data.frame
test = data.frame(y1 = sample(c(0, 1), size = 1000, replace = TRUE),
y2 = sample(c(0, 1), size = 1000, replace = TRUE),
y3 = sample(c(0, 1), size = 1000, replace = TRUE),
x1 = rnorm(1000,100,10),
x2 = rnorm(1000,10,1),
x3 = rnorm(1000,6,2),
m1 = rnorm(1000,3,1),
m2 = rnorm(1000,2,0.5),
m3 = rnorm(1000,9,0.1),
c1 = rnorm(1000,5,0.4),
c2 = rnorm(1000,2,0.2),
c3 = rnorm(1000,7,0.9)
)
glm_model_explore(data = test,
response_variable = c(y1,y2,y3),
predictor_variable = c(x1,x2,x3),
two_way_interaction_variable = c(m1,m2,m3),
family = binomial(link = 'logit'),
control_variable = c(c1,c2,c3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.