How to Calculate MSE in R

MSE stands for Mean Squared Error, and can be used to compare our estimated values and observed values in a model. The following is the formula of MSE. How to Calculate MSE in R R can be used to calculate Mean Squared Error (MSE). The following is the core syntax, which calculates the ratio of … Read more

Calculate Mean Squared Residuals (MSR) in R

Mean Squared Residuals (MSR) is ratio between Sum Squared Residuals and the number of observations, i.e., n. The following is the formula of MSR. MSR can be used compare our estimated values and observed values for regression models. R can be used to calculate Mean Squared Residuals (MSR), and the following is the core syntax. … Read more

Calculate Sum of Squared Residuals (SSR) in R

Introduction Sum of Squared Residuals SSR is also known as residual sum of squares (RSS) or sum of squared errors (SSE). The following is the formula. SSR can be used compare our estimated values and observed values for regression models. R can be used to calculate SSR, and the following is the core R syntax. … Read more

Logistic Regression: Definition and Example

1. What is Logistic Regression? Logistic regression is a model testing the relationship between Y (which is as a binary variable) and X (X can be more than one). logistic regression is also called logit regression. 2. Difference between logistic regression and linear regression We often encounter situations where the result is binary, such as yes … Read more

What is Linear Regression Model? Definition and Example

1. Definition of Linear Regression Model Multiple linear regression is a linear model accessing the relationship between a dependent variable (DV, or Y) and multiple intendent variables (IV, or X). For instance, you might want to test how consumer purchase intention can be impacted by price as well as by household income. In this case, … Read more

How to Write Null and Alternative Hypothesis for Two-Way ANOVA

This tutorial shows how to write null and alternative hypothesis for two-way ANOVA. It is an extension of my other tutorial on this same topic. 1. Introduction A two-way ANOVA is used to test whether the means from the two or more categorieal variables are significantly different from one another. For instance, below, there are two categorical variables, … Read more

Calculate Sum of Squares Total (SST) in R (2 Examples)

This tutorial shows how to calculate Sum of Squares Total (SST) in R. The following is the data being used. The hypothetical data being used has two categorical IVs (cities and stores) and one DV (sales). Note that, while it has two IVs, the calculation of SST actually does not need to use these two … Read more

Why Type I ANOVA is Sequential Sum of Squares (R code example)

Type 1 ANOVA is also called sequential sum of squares, because it considers the order effect of entering factors into the model. If you change the order of the factors in the model, the results will be different. The following uses an example in R to explain this. Step 1: Prepare the data The following is … Read more