Difference between Logit and Probit

This tutorial explains the difference between logit and probit in statistics with formulas and examples. Formula and Example for Logit We can start with the following formula. Thus, $$\beta_0+\beta_1x_1+…+\beta_nx_n$$ can be from $$-\infty$$ to $$+\infty$$, and $$p(y=1)$$ will be always within the range of $$(0,1)$$. We … Read more

Sum of Squares: Formulas and Examples

This tutorial includes the formula and examples for Sum of Squares (SS). Sum of Squares (SS) is a measure of deviation from the mean and the following is its formula. It is to square the distance between each data point and the mean then add them together. Formula of Sum of Squares (SS) The following is … Read more

ANOVA Assumptions

There are 3 assumption for ANOVA: Normality – The responses for each factor level have a normal population distribution. Equal variances (Homogeneity of Variance) – These distributions have the same variance. Independence – The data are independent. You can use R to test the assumptions of normality and equality variances (The following are the two tutorials). In contrast, … Read more

Probability Density Functions in R (Examples)

The tutorial shows examples of how you can use built-in Probability Density Functions (PDF) in R, including PDF for normal distribution (dnorm), uniform distribution (dunif), and exponential distribution (dexp). Example 1: PDF for Normal Distribution Normal distribution PDF dnorm() in R returns the density of probability at 2. Note that it is standard normal distribution … Read more

Probability Density Function: Definition and Examples

Probability Density Function (PDF) provides the likelihood that the value of a random variable will fall between a certain range. PDF typically is used for continuous random variables. For discrete random variables, we use probability mass function. Definition of Probability Density Function (PDF) Probability Density Function (PDF) is defined as the probability of a value … Read more

How to Interpret Interaction Effects in Linear Regression (4 Steps)

This tutorial shows how to interpret interaction effects in linear regression models. In summary, there are two perspectives, (a) mean difference perspective and (b) slope difference perspective. Interpret Interaction Effect in Linear Regression (a) Mean Difference Perspective: One way to interpret interaction effects in linear regression is based on mean differences. A significant interaction means … Read more

How to Solve Linear Regression Using Linear Algebra (4 Steps)

We can solve linear regression (i.e., estimate the regression coefficients) using just linear algebra. Below is the process of 4 steps to do regression analysis via matrix multiplication. Step 1: Prepare the matrix We actually can expand the function above to another format below. The function below can give you a more detailed idea of … Read more

Use sklearn to Calculate SSR in Python

This tutorial shows how to use sklearn to calculate SSR, which stands for Sum of Squared Residuals. SSR is also known as residual sum of squares (RSS) or sum of squared errors (SSE). Steps of Using sklearn to Calculate SSR in Python Step 1: Prepare data We are going to use a built-in dataset called … Read more

How to Calculate Sum of Squared Residuals in Python

This tutorial shows how you calculate Sum of Squared Residuals in Python with detailed steps. 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 to calculate SSR. SSR can be used compare our estimated values and observed values for … Read more

How to Calculate MSR in Python

MSR stands for Mean Squared Residuals. MSR can be used to compare the the difference between estimated Y and observed Y in model. It is ratio between Sum Squared Residuals and the number of observations, i.e., n. The following is the formula of MSR. MSR has the exact same formula as the biased MSE. How … Read more