Category: Data Analytics
Calculate p-value in Linear Regression
This tutorial shows how you can calculate p-value for linear regression. It includes formulas and data examples in Python. Formulas for p-value in Linear Regression We can estimate the regression coefficient B using the following formula. Where, Such calculation only...
Read Full Article →
One Sample t-test in R
The following is the core R syntax to do one sample t-test in R. In particular, Method 1 uses built-in R function, whereas method 2 writes the function to test one sample t-test in R from scratch. Method 1: t.test(vector_name,...
Read Full Article →
Plot for Interactions of 2 Categorical Variables in Python (with example)
This tutorial shows how to plot interactions of 2 categorical independent variables in Python. The following shows both the ANOVA and linear regression outputs. You will see that ANOVA is also a linear regression model. Thus, it does not matter...
Read Full Article →
How to Calculate Predicated Y in Linear Regression in Python
This tutorial shows how you can calculate predicted Y (or, estimated Y) in linear regression in Python. Steps of Calculating Predicated Y in Linear Model in Python Step 1: Prepare data, X and Y Output: X: [[ 5] [ 2]...
Read Full Article →
Linear Regression: Python Numpy Implementation from Scratch
This tutorial shows how you can conduct linear regression Python Numpy from scratch. 1. Math and Matrix of Linear Regression We can use just use pure matrix calculation to estimate the regression coefficients in a linear regression model. Below is...
Read Full Article →
Python: Type I, Type II, and Type III ANOVA
1. Introduction Type I, Type II, and Type III ANOVA are 3 different ways of calculating sum of squares in ANOVA. Type I ANOVA: SS(A) for factor A SS(B | A) for factor B SS(AB | A, B) for interaction...
Read Full Article →
Use sklearn for Linear Regression in Python
Introduction We can use sklearn.linear_model.LinearRegression to do linear regression in Python. The following is the core syntax of using sklearn. lm.fit(IVs, DV) Where, IVs: the independent variables DV: the dependent variable Example for Linear Regression Model The following is the...
Read Full Article →
nltk: How to Remove Stop words in Python
This tutorial shows how you can remove stop words using nltk in Python. Stop words are words not carrying important information, such as propositions (“to”, “with”), articles (“an”, “a”, “the”), or conjunctions (“and”, “or”, “but”). We first need to import...
Read Full Article →
What is One-way ANOVA? Formula and Example
One-Way ANOVA is to compare the means of different groups, to see whether the mean difference is statistically significant. For instance, you would like to compare the average household size of three cities. You can collect 3 samples from these...
Read Full Article →
Correlation: Definition, Formula, and Examples
What is Correlation? Correlation is a statistical measure of the relationship between two variables, X and Y. For instance, you can measure to what extent temperature (X) is related to the production of ice cream (Y). You probably would expect...
Read Full Article →