Description Usage Arguments Value Examples

View source: R/logistic_reg_w_interaction.R

Conduct logistic regression for a model with an interaction between two predictor variables

1 2 3 4 5 6 7 8 9 10 11 12 13 14 |

`data` |
a data object (a data frame or a data.table) |

`dv_name` |
name of the dependent variable (must be a binary variable) |

`iv_1_name` |
name of the first independent variable |

`iv_2_name` |
name of the second independent variable |

`round_p` |
number of decimal places to which to round p-values (default = 3) |

`round_chi_sq` |
number of decimal places to which to round chi square statistics (default = 2) |

`dv_ordered_levels` |
a vector with the ordered levels of the
dependent variable, the first and second elements of which will be
coded as 0 and 1, respectively, to run logistic regression.
E.g., |

`iv_1_ordered_levels` |
(only if the first independent variable
is a binary variable) a vector with the ordered levels of the first
independent variable, the first and second elements of which will be
coded as 0 and 1, respectively, to run logistic regression.
E.g., |

`iv_2_ordered_levels` |
(only if the second independent variable
is a binary variable) a vector with the ordered levels of the first
independent variable, the first and second elements of which will be
coded as 0 and 1, respectively, to run logistic regression.
E.g., |

`one_line_summary_only` |
logical. Should the output simply be a printout of a one-line summary on the interaction term? (default = FALSE) |

`p_value_interaction_only` |
logical. Should the output simply be a p-value of the interaction term in the logistic regression model? (default = FALSE) |

`return_dt_w_binary` |
logical. If |

the output will be a summary of logistic regression results, unless set otherwise by arguments to the function.

1 2 | ```
logistic_reg_w_interaction(data = mtcars, dv_name = "vs",
iv_1_name = "mpg", iv_2_name = "am")
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.