View source: R/calculate_regression_diagnostics.R
| calculate_regression_diagnostics | R Documentation |
For each period in the data, fits a log-linear model and computes diagnostics:
Normality test (Shapiro-Wilk)
Adjusted R-squared
Breusch-Pagan test for heteroscedasticity
Durbin-Watson test for autocorrelation
calculate_regression_diagnostics(
dataset,
period_variable,
dependent_variable,
numerical_variables = NULL,
categorical_variables = NULL
)
dataset |
A data.frame with input data |
period_variable |
Name of the period variable (string) |
dependent_variable |
Name of the dependent variable (string) |
numerical_variables |
Vector of numerical independent variables (default = NULL) |
categorical_variables |
Vector of categorical independent variables (default = NULL) |
A data.frame with diagnostics by period
Mohammad Kardal, Vivek Gajadhar
diagnostics <- calculate_regression_diagnostics(
dataset = data_constraxion,
period_variable = "period",
dependent_variable = "price",
numerical_variables = c("floor_area", "dist_trainstation"),
categorical_variables = c("dummy_large_city", "neighbourhood_code")
)
head(diagnostics)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.