summaryrefslogtreecommitdiff
path: root/331/CH10/EX10.11/Example_10_11.sce
blob: cb75f880baf16b68ee2323193eae2cc5490f38e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//Caption: Linear regression and Time series
//Simple regression
//Example10.11
//Page393
clear;
clc;
MeanX = 25;
Meany = 150;
StdX = 2;
StdY = 8;
r = 0.9;
//Estimation of the value of Y when X =10
X = 10;
Y = Meany+r*(StdY/StdX)*(X-MeanX);
disp(Y,'Estimated value of Y when X =10, Y=')
//Estimation of the value of X when Y = 96
Y = 96;
X = MeanX+r*(StdX/StdY)*(Y-Meany);
disp(X,'Estimated value of X when Y =96, X=')
//Result
//Estimated value of Y when X =10, Y=   
// 
//    96.  
// 
// Estimated value of X when Y =96, X=   
// 
//    12.85