summaryrefslogtreecommitdiff
path: root/331/CH10/EX10.8
diff options
context:
space:
mode:
Diffstat (limited to '331/CH10/EX10.8')
-rwxr-xr-x331/CH10/EX10.8/Example_10_8.sce33
1 files changed, 33 insertions, 0 deletions
diff --git a/331/CH10/EX10.8/Example_10_8.sce b/331/CH10/EX10.8/Example_10_8.sce
new file mode 100755
index 000000000..7078a92ce
--- /dev/null
+++ b/331/CH10/EX10.8/Example_10_8.sce
@@ -0,0 +1,33 @@
+//Caption: Linear regression and Time series
+//Simple regression
+//Example10.8
+//Page388
+clear;
+clc;
+x = [1997,1998,1999,2000,2001,2002];//Year
+X = x-2000;
+y = [50,60,50,80,72,90];//Demand
+[b,a,sig]=reglin(X,y);//Linear Regression
+disp(b,'Regression coefficient b=')
+disp(a,'Regression coefficient a=')
+D = 2008;
+Y = a+b*(D-2000);
+disp(Y,'Demand for the year 2008 Y=')
+disp(Y*100000,'Demand in lakhs tons Y=')
+//Result
+//Regression coefficient b=
+//
+// 7.6
+//
+// Regression coefficient a=
+//
+// 70.8
+//
+// Demand for the year 2008 Y=
+//
+// 131.6
+//
+// Demand in lakhs tons Y=
+//
+// 13160000.
+// \ No newline at end of file