Description Usage Arguments Value Author(s) Examples
Get the proportion of each combination of two predictors' levels having each outcome level as well as the lower and higher ends of the 95% confidence interval of the proportion.
1 |
data |
The dataframe containing the predictor and outcome variables. |
predictor1 |
The first predictor variable name. |
predictor2 |
The second predictor variable name. |
outcome |
The outcome variable name. |
Returns a dataframe that includes the following columns:
predictor1 |
The first predictor variable levels. |
predictor2 |
The second predictor variable levels. |
outcome |
The outcome variable levels. |
n |
The number of observations for each combination of levels of both predictors and the outcome. |
sum_n |
The total number of observations for each combination of levels of both predictors. |
prop |
The proportion of each combination of both predictor levels having each outcome level. |
low_95ci |
The lower end of the 95% confidence interval of the proportion. |
high_95ci |
The upper end of the 95% confidence interval of the proportion. |
Andrew Kostandy (andrew.kostandy@gmail.com)
1 2 3 4 | Titanic2 <- as.data.frame(Titanic)
Titanic2 <- Titanic2[rep(seq(1:nrow(Titanic2)), Titanic2$Freq), -5]
get_prop2(Titanic2, Class, Sex, Survived)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.