powered by
Conduct a loglinear analysis
loglinear_analysis( data = NULL, dv_name = NULL, iv_1_name = NULL, iv_2_name = NULL, iv_1_values = NULL, iv_2_values = NULL, output = "all", round_p = 3, round_chi_sq = 2, mosaic_plot = TRUE, report_as_field = FALSE )
a data object (a data frame or a data.table)
name of the dependent variable
name of the first independent variable
name of the second independent variable
restrict all analyses to observations having these values for the first independent variable
restrict all analyses to observations having these values for the second independent variable
type of the output. If output_type = "all", the function will return a results summary and print a mosaic plot. (default = "all")
output_type = "all"
number of decimal places to which to round p-values (default = 3)
number of decimal places to which to round chi-squared test statistics (default = 2)
If mosaic_plot = TRUE, a mosaic plot will be printed (default = TRUE)
mosaic_plot = TRUE
If report_as_field = TRUE, reports summary will follow the format suggested by Andy Field (2012) (ISBN: 978-1-4462-0045-2, p. 851)
report_as_field = TRUE
# \donttest{ loglinear_analysis(data = data.frame(Titanic), "Survived", "Sex", "Age") # }
Run the code above in your browser using DataLab