{"id":2873,"date":"2026-10-18T17:47:50","date_gmt":"2026-10-18T17:47:50","guid":{"rendered":"https:\/\/prwatech.in\/blog\/?p=2873"},"modified":"2026-10-19T14:25:57","modified_gmt":"2026-10-19T14:25:57","slug":"regression-analysis-tutorial-with-examples","status":"publish","type":"post","link":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/regression-analysis-tutorial-with-examples\/","title":{"rendered":"Regression Analysis Tutorial with Examples"},"content":{"rendered":"<h1><strong><b>Regression Analysis Tutorial With Examples<\/b><\/strong><\/h1>\n<p>How much will a flat of 1,500 square feet cost in your city? How many units will a shop sell next month if it spends more on stock? How much will a patient&#8217;s blood sugar change in a year? Each of these questions asks for a number, and each can be answered by looking at how one thing changes when another changes. That is what regression analysis does.<\/p>\n<p>Regression analysis is one of the oldest and most useful tools in statistics and machine learning. It finds the relationship between an outcome you want to predict and the factors that influence it, and it turns that relationship into a formula you can use. It tells you which factors matter, how strongly, and what to expect when they change. Banks, hospitals, retailers and factories use it every day.<\/p>\n<p>This tutorial explains regression analysis from the start. We cover what it is, why we use it, and the main types, then go deep on linear regression, the simplest and most common kind. Two worked Python examples follow, one with a single input and one with three. After them comes a proper test on data the model has not seen, with the right measures of error. We end with assumptions, common mistakes and a short FAQ.<\/p>\n<h2><strong><b>What is Regression Analysis?<\/b><\/strong><\/h2>\n<p>Regression analysis is a method that studies how a <strong><b>dependent variable<\/b><\/strong>, the outcome you want to predict, depends on one or more <strong><b>independent variables<\/b><\/strong>, the inputs that influence it. It builds a model linking them, and the model predicts the average value of the outcome for given inputs.<\/p>\n<p>For example, the price of a house is the dependent variable. Its area, number of bedrooms and age are the independent variables.<\/p>\n<div style=\"border: 1px solid #d9e0ea; border-radius: 8px; overflow-x: auto; margin: 20px 0; -webkit-overflow-scrolling: touch;\">\n<table style=\"width: 100%; min-width: 600px; border-collapse: collapse; font-family: Arial,Helvetica,sans-serif; font-size: 16px; line-height: 1.6; color: #1f2937;\">\n<caption style=\"caption-side: top; text-align: left; padding: 14px 16px; font-weight: bold; font-size: 17px; color: #0f2a4a;\">Regression terms<\/caption>\n<thead>\n<tr>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38; width: 200px;\" scope=\"col\">Term<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">Meaning<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">Dependent variable<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">The outcome you want to predict. Also called the target or response, and often written as y<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">Independent variable<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">An input that influences the outcome. Also called a feature or predictor, and often written as x<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">Coefficient<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">How much the outcome changes when that input rises by one unit<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">Intercept<\/th>\n<td style=\"padding: 12px 16px;\">The predicted outcome when all inputs are zero<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2><strong><b>Why do We Need Regression Analysis?<\/b><\/strong><\/h2>\n<p>Regression helps in two ways. It shows which variables matter and how much, and it predicts outcomes for new cases.<\/p>\n<ul>\n<li><b><\/b><strong><b>Finding what matters. <\/b><\/strong>Does gender affect salary after allowing for experience? Which factors push up a household&#8217;s water use?<\/li>\n<li><b><\/b><b><\/b>What is the likely price of a house, the sales for next month, or the demand for power on a hot day?<\/li>\n<li><b><\/b><strong><b>Measuring strength. <\/b><\/strong>How closely are two things related, and is the link positive or negative?<\/li>\n<li><b><\/b><strong><b>Testing ideas. <\/b><\/strong>Does an extra rupee of marketing really lead to extra sales?<\/li>\n<\/ul>\n<p>Take household water use. Use depends on the number of people, the size of the home, the season and whether there is a garden. Regression estimates how much each of these adds, so a water utility can plan supply.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4741\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/reg1.png\" alt=\"Regression Analysis Tutorial with Examples\" width=\"850\" height=\"550\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/reg1.png 651w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/reg1-300x194.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h2><strong><b>What Questions does Regression Answer?<\/b><\/strong><\/h2>\n<ul>\n<li>Is there a relationship between the variables?<\/li>\n<li>How strong is it?<\/li>\n<li>Is it positive, where both rise together or negative, where one rises as the other falls?<\/li>\n<li>How much does the outcome change for each unit change in an input?<\/li>\n<li>What outcome should we expect for a new case?<\/li>\n<\/ul>\n<h2><strong><b>Types of Regression Analysis<\/b><\/strong><\/h2>\n<p>Regression comes in several forms, depending on the number of inputs and the shape of the relationship.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4742\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/reg2.png\" alt=\"Classification of Regression Analysis\" width=\"850\" height=\"666\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/reg2.png 537w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/reg2-300x235.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<div style=\"border: 1px solid #d9e0ea; border-radius: 8px; overflow-x: auto; margin: 20px 0; -webkit-overflow-scrolling: touch;\">\n<table style=\"width: 100%; min-width: 700px; border-collapse: collapse; font-family: Arial,Helvetica,sans-serif; font-size: 16px; line-height: 1.6; color: #1f2937;\">\n<caption style=\"caption-side: top; text-align: left; padding: 14px 16px; font-weight: bold; font-size: 17px; color: #0f2a4a;\">Types of regression<\/caption>\n<thead>\n<tr>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38; width: 170px;\" scope=\"col\">Type<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">What it does<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">Use it when<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">Simple linear<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">One input, a straight line<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">One factor drives the outcome<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">Multiple linear<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Two or more inputs, a flat surface<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Several factors drive the outcome<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">Polynomial<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Fits a curve<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">The relationship bends<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">Logistic<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Predicts a category by probability<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">The outcome is yes or no. It is a classification method despite its name<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">Ridge and lasso<\/th>\n<td style=\"padding: 12px 16px;\">Linear regression with a penalty on large coefficients<\/td>\n<td style=\"padding: 12px 16px;\">You have many inputs or they overlap<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Building a regression model is a cycle. You fit a model, check how well it does on data it has not seen, and then improve it by adding or removing inputs, or by changing the type. Several rounds are normal.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4743\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/reg3.png\" alt=\"Regression Analysis Tutorial with Examples\" width=\"850\" height=\"1347\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/reg3.png 513w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/reg3-189x300.png 189w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h2><strong><b>Introduction to Linear Regression<\/b><\/strong><\/h2>\n<p>Linear regression fits a straight line through your data. The line has an equation you may remember from school: <strong><b>y = mx + c<\/b><\/strong>.<\/p>\n<ul>\n<li><b><\/b><strong><b>y <\/b><\/strong>is the dependent variable, the thing we predict.<\/li>\n<li><b><\/b><strong><b>x <\/b><\/strong>is the independent variable, the input.<\/li>\n<li><b><\/b><strong><b>m <\/b><\/strong>is the slope, or coefficient. It is how much y changes for each unit increase in x.<\/li>\n<li><b><\/b><strong><b>c<\/b><\/strong>is the intercept, the value of y when x is zero.<\/li>\n<\/ul>\n<p>The line chosen is the best fit line. It is the one that makes the total of the squared gaps between the actual points and the line as small as possible. This method is called least squares.<\/p>\n<p>A slope above zero means the two variables rise together, which is a positive relationship. A slope below zero means one falls as the other rises, which is a negative relationship. These describe the slope. They are not separate types of regression.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4750\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/lr1.png\" alt=\"introduction to linear regression analysis\" width=\"850\" height=\"429\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/lr1.png 994w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/lr1-300x152.png 300w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/lr1-768x388.png 768w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h2><strong><b>Types of Linear Regression<\/b><\/strong><\/h2>\n<h3><strong><b>Simple Linear Regression<\/b><\/strong><\/h3>\n<p>Simple linear regression has one input. Here is the price of five flats against their area. The table comes from the original page, and I corrected the heading from Fits to Feet.<\/p>\n<div style=\"border: 1px solid #d9e0ea; border-radius: 8px; overflow-x: auto; margin: 20px 0; -webkit-overflow-scrolling: touch;\">\n<table style=\"width: 100%; min-width: 420px; border-collapse: collapse; font-family: Arial,Helvetica,sans-serif; font-size: 16px; line-height: 1.6; color: #1f2937;\">\n<caption style=\"caption-side: top; text-align: left; padding: 14px 16px; font-weight: bold; font-size: 17px; color: #0f2a4a;\">House area and price data<\/caption>\n<thead>\n<tr>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">Area (square feet)<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">Price (Rs)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">2,550<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">50,00,000<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">3,200<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">55,00,000<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">3,500<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">66,00,000<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">3,800<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">68,00,000<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">4,000<\/th>\n<td style=\"padding: 12px 16px;\">75,00,000<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4751\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/lr2.png\" alt=\"simple linear regression with example\" width=\"850\" height=\"476\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/lr2.png 427w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/lr2-300x168.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p>The program below fits a line to this table and predicts the price of a flat of 4,500 square feet. It is Part 1 of the full program shown in the next section. The complete code, including the imports the original page left out, is below.<\/p>\n<h3><strong><b>Multiple Linear Regression<\/b><\/strong><\/h3>\n<p>Multiple linear regression has two or more inputs. The equation grows to <strong><b>y = m1x1 + m2x2 + &#8230; + mnxn + c<\/b><\/strong>, where x1 to xn are the inputs and m1 to mn are their coefficients. Each coefficient shows the effect of that input while the others are held fixed.<\/p>\n<p>For houses, the inputs could be area, number of bedrooms and age of the building, and the output is the price. The original page promised a table for this example but never showed it. In Part 2 below, I use a small table of 10 homes that I made up, with prices in lakh rupees.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4752\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/lr3.png\" alt=\"Multiple linear regression with example\" width=\"850\" height=\"562\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/lr3.png 853w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/lr3-300x198.png 300w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/lr3-768x508.png 768w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h2><strong><b>Linear Regression in Python With scikit learn<\/b><\/strong><\/h2>\n<p>This program has three parts. Part 1 is the simple example with five flats. Part 2 is the multiple example with three inputs. Part 3 uses the diabetes dataset that comes with scikit learn, with 442 patients, to show how to test a model properly on unseen data. All imports are included.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">import numpy as np\r\nimport pandas as pd\r\nfrom sklearn.datasets import load_diabetes\r\nfrom sklearn.dummy import DummyRegressor\r\nfrom sklearn.linear_model import LinearRegression\r\nfrom sklearn.metrics import mean_absolute_error, mean_squared_error, r2_score\r\nfrom sklearn.model_selection import train_test_split\r\n\r\n# Part 1: simple linear regression, one input\r\nhouse = pd.DataFrame({\r\n    \"area\": [2550, 3200, 3500, 3800, 4000],\r\n    \"price\": [5000000, 5500000, 6600000, 6800000, 7500000],\r\n})\r\nX = house[[\"area\"]]\r\ny = house[\"price\"]\r\nmodel = LinearRegression().fit(X, y)\r\nprint(\"Slope (price per extra sq ft):\", round(model.coef_[0], 1))\r\nprint(\"Intercept:\", round(model.intercept_, 1))\r\nprint(\"R squared on these 5 rows:\", round(model.score(X, y), 3))\r\nprint(\"Predicted price for 4500 sq ft:\", round(model.predict(pd.DataFrame({\"area\": [4500]}))[0]))\r\n\r\n# Part 2: multiple linear regression, three inputs (made up data)\r\nhomes = pd.DataFrame({\r\n    \"area\":     [1200, 1800, 1500, 2200, 2000, 2800, 2500, 3300, 3000, 3600],\r\n    \"bedrooms\": [2, 3, 2, 3, 4, 4, 3, 5, 4, 5],\r\n    \"age\":      [15, 5, 20, 10, 2, 12, 6, 8, 18, 3],\r\n    \"price\":    [54, 84, 61, 102, 98, 123, 116, 149, 131, 166],\r\n})\r\nXm = homes[[\"area\", \"bedrooms\", \"age\"]]\r\nmulti = LinearRegression().fit(Xm, homes[\"price\"])\r\nfor name, coef in zip(Xm.columns, multi.coef_):\r\n    print(name, \"coefficient:\", round(float(coef), 3))\r\nprint(\"Intercept:\", round(float(multi.intercept_), 2))\r\nprint(\"R squared on these 10 rows:\", round(multi.score(Xm, homes[\"price\"]), 3))\r\nnew = pd.DataFrame({\"area\": [2400], \"bedrooms\": [3], \"age\": [6]})\r\nprint(\"Predicted price (lakh) for 2400 sq ft, 3 bedrooms, 6 years old:\", round(multi.predict(new)[0], 1))\r\n\r\n# Part 3: judging a model properly on unseen data\r\ndata = load_diabetes()\r\nX_train, X_test, y_train, y_test = train_test_split(\r\n    data.data, data.target, test_size=0.3, random_state=0\r\n)\r\nlin = LinearRegression().fit(X_train, y_train)\r\npred = lin.predict(X_test)\r\nprint(\"Train R squared:\", round(lin.score(X_train, y_train), 3))\r\nprint(\"Test R squared:\", round(r2_score(y_test, pred), 3))\r\nprint(\"Test MAE:\", round(mean_absolute_error(y_test, pred), 1))\r\nprint(\"Test RMSE:\", round(float(np.sqrt(mean_squared_error(y_test, pred))), 1))\r\nflat = DummyRegressor(strategy=\"mean\").fit(X_train, y_train)\r\nprint(\"Flat average line, test R squared:\", round(flat.score(X_test, y_test), 3) + 0.0)<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">Slope (price per extra sq ft): 1715.2\r\nIntercept: 431269.3\r\nR squared on these 5 rows: 0.925\r\nPredicted price for 4500 sq ft: 8149536\r\narea coefficient: 0.044\r\nbedrooms coefficient: 0.123\r\nage coefficient: -0.684\r\nIntercept: 10.6\r\nR squared on these 10 rows: 0.998\r\nPredicted price (lakh) for 2400 sq ft, 3 bedrooms, 6 years old: 111.4\r\nTrain R squared: 0.554\r\nTest R squared: 0.393\r\nTest MAE: 44.6\r\nTest RMSE: 55.7\r\nFlat average line, test R squared: 0.0<\/pre>\n<\/div>\n<h3><strong><b>Part 1: Simple Linear Regression Results<\/b><\/strong><\/h3>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">Slope (price per extra sq ft): 1715.2\r\nIntercept: 431269.3\r\nR squared on these 5 rows: 0.925\r\nPredicted price for 4500 sq ft: 8149536<\/pre>\n<\/div>\n<ul>\n<li><b><\/b><strong><b>The slope is 1,715.<\/b><\/strong>Each extra square foot adds about Rs 1,715 to the price.<\/li>\n<li><b><\/b><strong><b>The prediction for 4,500 square feet is about Rs 81.5 lakh.<\/b><\/strong>That is 1,715.2 times 4,500 plus 431,269.<\/li>\n<li><b><\/b><strong><b>Be careful with this prediction.<\/b><\/strong>The data only goes up to 4,000 square feet, and 4,500 is outside it. Predicting beyond your data is called extrapolation, and it is risky because the straight line may not continue.<\/li>\n<li><b><\/b><strong><b>R squared of 0.925 is on only 5 rows,<\/b><\/strong>and the same rows were used to fit the line. With so few points, treat it as a demonstration, not a result.<\/li>\n<\/ul>\n<h3><strong><b>Part 2: Multiple Linear Regression Results<\/b><\/strong><\/h3>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">area coefficient: 0.044\r\nbedrooms coefficient: 0.123\r\nage coefficient: -0.684\r\nIntercept: 10.6\r\nR squared on these 10 rows: 0.998\r\nPredicted price (lakh) for 2400 sq ft, 3 bedrooms, 6 years old: 111.4<\/pre>\n<\/div>\n<ul>\n<li><b><\/b><strong><b>Area:<\/b><\/strong>each extra square foot adds about 0.044 lakh, or Rs 4,400, holding the others fixed.<\/li>\n<li><b><\/b><strong><b>Age:<\/b><\/strong>each extra year of age lowers the price by about 0.68 lakh. The negative sign shows a negative relationship.<\/li>\n<li><b><\/b><strong><b>Bedrooms:<\/b><\/strong>the coefficient is small at 0.123, because bigger homes already have more bedrooms, and area captures most of the effect. When inputs overlap like this, the coefficients become unstable on small data.<\/li>\n<li><b><\/b><strong><b>R squared of 0.998 is very high because I made the data up with little noise.<\/b><\/strong>Real data is never this clean.<\/li>\n<\/ul>\n<p>In the original page&#8217;s code, the target was swapped and the model was misspelt. Here the target is price, and the prediction is made for a home of 2,400 square feet with 3 bedrooms and 6 years of age.<\/p>\n<h3><strong><b>Part 3: Testing on Data the Model Has Not Seen<\/b><\/strong><\/h3>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">Train R squared: 0.554\r\nTest R squared: 0.393\r\nTest MAE: 44.6\r\nTest RMSE: 55.7\r\nFlat average line, test R squared: 0.0<\/pre>\n<\/div>\n<ul>\n<li><b><\/b><strong><b>Test R squared is lower than train.<\/b><\/strong>The model scores 0.554 on the data it learned from and 0.393 on new data. The original page only ever checked the training data, so it would have shown the higher number.<\/li>\n<li><b><\/b><strong><b>R squared is not accuracy.<\/b><\/strong>It is the share of the variation in the outcome that the model explains. A score of 0.393 means it explains about 39 percent.<\/li>\n<li><b><\/b><strong><b>MAE and RMSE are in the units of the target.<\/b><\/strong>On average, predictions are off by about 44.6, and RMSE, which punishes big misses more, is 55.7.<\/li>\n<li><b><\/b><strong><b>A flat average line scores 0.0.<\/b><\/strong>That is the baseline. The model beats it, so it has learned something, though not a great deal on this data.<\/li>\n<li><b><\/b><strong><b>R squared can go below zero.<\/b><\/strong>A model that does worse than the flat average line scores a negative number. The original page says it is between 0 and 1, which is not always true.<\/li>\n<\/ul>\n<h2><strong><b>Key Measures of a Regression Model<\/b><\/strong><\/h2>\n<div style=\"border: 1px solid #d9e0ea; border-radius: 8px; overflow-x: auto; margin: 20px 0; -webkit-overflow-scrolling: touch;\">\n<table style=\"width: 100%; min-width: 760px; border-collapse: collapse; font-family: Arial,Helvetica,sans-serif; font-size: 16px; line-height: 1.6; color: #1f2937;\">\n<caption style=\"caption-side: top; text-align: left; padding: 14px 16px; font-weight: bold; font-size: 17px; color: #0f2a4a;\">Regression measures<\/caption>\n<thead>\n<tr>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38; width: 160px;\" scope=\"col\">Measure<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">What it tells you<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">Read it like this<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">R squared<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Share of the variation the model explains<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">1 is perfect, 0 is no better than the average, below 0 is worse<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">MAE<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Average size of the error<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">In the same units as the target. Easy to explain<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">MSE<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Average of the squared errors<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Punishes large errors. In squared units<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">RMSE<\/th>\n<td style=\"padding: 12px 16px;\">Square root of MSE<\/td>\n<td style=\"padding: 12px 16px;\">In the same units as the target. Punishes large errors<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2><strong><b>Assumptions of Linear Regression<\/b><\/strong><\/h2>\n<ol>\n<li><b><\/b><strong><b>A straight line relationship <\/b><\/strong>between each input and the outcome.<\/li>\n<li><b><\/b><strong><b>Independent errors. <\/b><\/strong>One row&#8217;s error should not predict another&#8217;s.<\/li>\n<li><b><\/b><strong><b>Constant spread of errors. <\/b><\/strong>The gaps should be about the same size across all predictions.<\/li>\n<li><b><\/b><strong><b>Errors roughly normal,<\/b><\/strong>which matters mainly when you want confidence intervals.<\/li>\n<li><b><\/b><strong><b>Little overlap between inputs. <\/b><\/strong>Strongly related inputs make coefficients unstable, as the bedrooms example shows.<\/li>\n<\/ol>\n<p>Inputs must be numbers. If you have categories such as city or colour, encode them first.<\/p>\n<h2><strong><b>Advantages and Disadvantages of Regression analysis<\/b><\/strong><\/h2>\n<h3><strong><b>Advantages<\/b><\/strong><\/h3>\n<ul>\n<li>Simple, fast and easy to explain to anyone.<\/li>\n<li>Coefficients show the effect of each input.<\/li>\n<li>A strong baseline for any numeric prediction.<\/li>\n<li>Works with small data.<\/li>\n<\/ul>\n<h3><strong><b>Disadvantages<\/b><\/strong><\/h3>\n<ul>\n<li>Assumes a straight line, so it misses curved patterns.<\/li>\n<li>Sensitive to outliers, because squared errors punish extreme points.<\/li>\n<li>Overlapping inputs make coefficients unstable.<\/li>\n<li>Predictions outside the range of the data can be unreliable.<\/li>\n<\/ul>\n<h2><strong><b>Where Regression Analysis is Used?<\/b><\/strong><\/h2>\n<ul>\n<li><b><\/b><strong><b>Real estate.<\/b><\/strong>Estimating property prices.<\/li>\n<li><b><\/b><b><\/b>Forecasting sales from price, season and promotions.<\/li>\n<li><b><\/b><b><\/b>Estimating risk and returns.<\/li>\n<li><b><\/b><b><\/b>Linking measurements such as weight or age to health outcomes.<\/li>\n<li><b><\/b><b><\/b>Predicting output or machine wear from operating conditions.<\/li>\n<li><b><\/b><b><\/b>Forecasting power and water demand.<\/li>\n<\/ul>\n<h2><strong><b>Common Mistakes to Avoid<\/b><\/strong><\/h2>\n<ul>\n<li><b><\/b><strong><b>Judging by training data only. <\/b><\/strong>Always check on held out data.<\/li>\n<li><b><\/b><strong><b>Calling R squared accuracy. <\/b><\/strong>It measures fit, not accuracy.<\/li>\n<li><b><\/b><strong><b>Predicting far outside the data. <\/b><\/strong>Like 4,500 square feet from data that ends at 4,000.<\/li>\n<li><b><\/b><strong><b>Mixing up the target and the inputs. <\/b><\/strong>Check which column is y.<\/li>\n<li><b><\/b><strong><b>Feeding in categories as text. <\/b><\/strong>Encode them first.<\/li>\n<li><b><\/b><strong><b>Reading coefficients on overlapping inputs. <\/b><\/strong>They can swing wildly.<\/li>\n<li><b><\/b><strong><b>Mistaking a link for a cause. <\/b><\/strong>Regression shows a relationship, not that one thing causes the other.<\/li>\n<\/ul>\n<p>Regression analysis turns a table of numbers into a formula you can use and explain. Start with one input, then add more, and always test the result on data the model has not seen. Run the program above, replace my sample homes with your own data, and compare the model with a flat average line before you trust it. When the pattern bends, look at polynomial regression or a decision tree.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Regression Analysis Tutorial With Examples How much will a flat of 1,500 square feet cost in your city? How many units will a shop sell next month if it spends more on stock? How much will a patient&#8217;s blood sugar change in a year? Each of these questions asks for a number, and each can [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2985,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32,1696],"tags":[414,415,413,416],"class_list":["post-2873","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-machine-learning","category-machine-learning-modules","tag-classification-of-regression-analysis","tag-introduction-to-linear-regression-analysis","tag-regression-analysis-tutorial-with-examples","tag-types-of-linear-regression-analysis"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Regression Analysis Tutorial With Examples in Python | Prwatech<\/title>\n<meta name=\"description\" content=\"Learn what regression analysis is, how simple and multiple linear regression work, and run tested Python examples with R squared, MAE and RMSE.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/regression-analysis-tutorial-with-examples\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Regression Analysis Tutorial With Examples in Python | Prwatech\" \/>\n<meta property=\"og:description\" content=\"Learn what regression analysis is, how simple and multiple linear regression work, and run tested Python examples with R squared, MAE and RMSE.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/regression-analysis-tutorial-with-examples\/\" \/>\n<meta property=\"og:site_name\" content=\"Prwatech\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prwatech.in\/\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-18T17:47:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-19T14:25:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/Regression.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"768\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Prwatech\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Eduprwatech\" \/>\n<meta name=\"twitter:site\" content=\"@Eduprwatech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prwatech\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/regression-analysis-tutorial-with-examples\/\",\"url\":\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/regression-analysis-tutorial-with-examples\/\",\"name\":\"Regression Analysis Tutorial With Examples in Python | Prwatech\",\"isPartOf\":{\"@id\":\"https:\/\/prwatech.in\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/regression-analysis-tutorial-with-examples\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/regression-analysis-tutorial-with-examples\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/Regression.jpg\",\"datePublished\":\"2026-10-18T17:47:50+00:00\",\"dateModified\":\"2026-10-19T14:25:57+00:00\",\"author\":{\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3\"},\"description\":\"Learn what regression analysis is, how simple and multiple linear regression work, and run tested Python examples with R squared, MAE and RMSE.\",\"breadcrumb\":{\"@id\":\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/regression-analysis-tutorial-with-examples\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/regression-analysis-tutorial-with-examples\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/regression-analysis-tutorial-with-examples\/#primaryimage\",\"url\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/Regression.jpg\",\"contentUrl\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/Regression.jpg\",\"width\":1024,\"height\":768,\"caption\":\"What Is Regression\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/regression-analysis-tutorial-with-examples\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/prwatech.in\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Regression Analysis Tutorial with Examples\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/prwatech.in\/blog\/#website\",\"url\":\"https:\/\/prwatech.in\/blog\/\",\"name\":\"Prwatech\",\"description\":\"Share Ideas, Start Something Good.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/prwatech.in\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3\",\"name\":\"Prwatech\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g\",\"caption\":\"Prwatech\"},\"url\":\"https:\/\/prwatech.in\/blog\/author\/prwatech123\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Regression Analysis Tutorial With Examples in Python | Prwatech","description":"Learn what regression analysis is, how simple and multiple linear regression work, and run tested Python examples with R squared, MAE and RMSE.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/regression-analysis-tutorial-with-examples\/","og_locale":"en_US","og_type":"article","og_title":"Regression Analysis Tutorial With Examples in Python | Prwatech","og_description":"Learn what regression analysis is, how simple and multiple linear regression work, and run tested Python examples with R squared, MAE and RMSE.","og_url":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/regression-analysis-tutorial-with-examples\/","og_site_name":"Prwatech","article_publisher":"https:\/\/www.facebook.com\/prwatech.in\/","article_published_time":"2026-10-18T17:47:50+00:00","article_modified_time":"2026-10-19T14:25:57+00:00","og_image":[{"width":1024,"height":768,"url":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/Regression.jpg","type":"image\/jpeg"}],"author":"Prwatech","twitter_card":"summary_large_image","twitter_creator":"@Eduprwatech","twitter_site":"@Eduprwatech","twitter_misc":{"Written by":"Prwatech","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/regression-analysis-tutorial-with-examples\/","url":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/regression-analysis-tutorial-with-examples\/","name":"Regression Analysis Tutorial With Examples in Python | Prwatech","isPartOf":{"@id":"https:\/\/prwatech.in\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/regression-analysis-tutorial-with-examples\/#primaryimage"},"image":{"@id":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/regression-analysis-tutorial-with-examples\/#primaryimage"},"thumbnailUrl":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/Regression.jpg","datePublished":"2026-10-18T17:47:50+00:00","dateModified":"2026-10-19T14:25:57+00:00","author":{"@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3"},"description":"Learn what regression analysis is, how simple and multiple linear regression work, and run tested Python examples with R squared, MAE and RMSE.","breadcrumb":{"@id":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/regression-analysis-tutorial-with-examples\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/regression-analysis-tutorial-with-examples\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/regression-analysis-tutorial-with-examples\/#primaryimage","url":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/Regression.jpg","contentUrl":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/09\/Regression.jpg","width":1024,"height":768,"caption":"What Is Regression"},{"@type":"BreadcrumbList","@id":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/regression-analysis-tutorial-with-examples\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/prwatech.in\/blog\/"},{"@type":"ListItem","position":2,"name":"Regression Analysis Tutorial with Examples"}]},{"@type":"WebSite","@id":"https:\/\/prwatech.in\/blog\/#website","url":"https:\/\/prwatech.in\/blog\/","name":"Prwatech","description":"Share Ideas, Start Something Good.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/prwatech.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3","name":"Prwatech","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g","caption":"Prwatech"},"url":"https:\/\/prwatech.in\/blog\/author\/prwatech123\/"}]}},"_links":{"self":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/2873","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/comments?post=2873"}],"version-history":[{"count":31,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/2873\/revisions"}],"predecessor-version":[{"id":12024,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/2873\/revisions\/12024"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/media\/2985"}],"wp:attachment":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/media?parent=2873"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/categories?post=2873"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/tags?post=2873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}