|
53 | 53 | #' calculate(stat = "t", order = c("1", "0")) %>%
|
54 | 54 | #' visualize(method = "both")
|
55 | 55 |
|
56 |
| -visualize <- function(data, bins = 30, method = "randomization", |
| 56 | +visualize <- function(data, bins = 15, method = "randomization", |
57 | 57 | dens_color = "black",
|
58 | 58 | obs_stat = NULL,
|
59 | 59 | obs_stat_color = "#00BFC4",
|
@@ -125,7 +125,8 @@ visualize <- function(data, bins = 30, method = "randomization",
|
125 | 125 | infer_plot <- theory_z_plot(statistic_text = "z")
|
126 | 126 | }
|
127 | 127 |
|
128 |
| - else if(attr(data, "theory_type") == "Chi-square test of indep"){ |
| 128 | + else if(attr(data, "theory_type") %in% |
| 129 | + c("Chi-square test of indep", "Chi-square Goodness of Fit")){ |
129 | 130 | infer_plot <- theory_chisq_plot(deg_freedom = attr(data, "distr_param"),
|
130 | 131 | statistic_text = "Chi-Square",
|
131 | 132 | dens_color = dens_color)
|
@@ -170,7 +171,9 @@ visualize <- function(data, bins = 30, method = "randomization",
|
170 | 171 | obs_stat = obs_stat)
|
171 | 172 | }
|
172 | 173 |
|
173 |
| - else if(attr(data, "theory_type") == "Chi-square test of indep"){ |
| 174 | + else if( |
| 175 | + attr(data, "theory_type") %in% |
| 176 | + c("Chi-square test of indep", "Chi-square Goodness of Fit")){ |
174 | 177 | infer_plot <- both_chisq_plot(data = data,
|
175 | 178 | deg_freedom = attr(data, "distr_param"),
|
176 | 179 | statistic_text = "Chi-Square",
|
@@ -218,7 +221,7 @@ theory_t_plot <- function(deg_freedom, statistic_text = "t",
|
218 | 221 | both_t_plot <- function(data, deg_freedom, statistic_text = "t",
|
219 | 222 | dens_color = "black",
|
220 | 223 | obs_stat = NULL,
|
221 |
| - direction = NULL, bins = 30,...){ |
| 224 | + direction = NULL, bins = 15,...){ |
222 | 225 | # infer_t_plot <- ggplot(data = data, mapping = aes(x = stat))
|
223 | 226 |
|
224 | 227 | infer_t_plot <- shade_density_check(data = data, #gg_plot = infer_t_plot,
|
@@ -252,7 +255,7 @@ both_anova_plot <- function(data, deg_freedom_top,
|
252 | 255 | deg_freedom_bottom, statistic_text = "F",
|
253 | 256 | dens_color = "black",
|
254 | 257 | obs_stat = NULL,
|
255 |
| - direction = NULL, bins = 30,....){ |
| 258 | + direction = NULL, bins = 15,....){ |
256 | 259 |
|
257 | 260 | infer_anova_plot <- shade_density_check(data = data,
|
258 | 261 | obs_stat = obs_stat,
|
@@ -280,7 +283,7 @@ theory_z_plot <- function(statistic_text = "z", dens_color = "black", ...){
|
280 | 283 | both_z_plot <- function(data, statistic_text = "z",
|
281 | 284 | dens_color = "black",
|
282 | 285 | obs_stat = NULL,
|
283 |
| - direction = NULL, bins = 30,...){ |
| 286 | + direction = NULL, bins = 15,...){ |
284 | 287 | infer_z_plot <- shade_density_check(data = data,
|
285 | 288 | obs_stat = obs_stat,
|
286 | 289 | direction = direction,
|
@@ -309,7 +312,7 @@ theory_chisq_plot <- function(deg_freedom, statistic_text = "Chi-Square",
|
309 | 312 | both_chisq_plot <- function(data, deg_freedom, statistic_text = "Chi-Square",
|
310 | 313 | dens_color = "black",
|
311 | 314 | obs_stat = NULL,
|
312 |
| - direction = "greater", bins = 30,...){ |
| 315 | + direction = "greater", bins = 15,...){ |
313 | 316 |
|
314 | 317 | infer_chisq_plot <- shade_density_check(data = data,
|
315 | 318 | obs_stat = obs_stat,
|
|
0 commit comments