Você está na página 1de 10

XA=[7.5 56.25;7.6 57.76 ;8.5 72.25; 8.8 77.44;9.2 84.64;9.6 92.

16; 10 100]

XA =

7.5000 56.2500

7.6000 57.7600

8.5000 72.2500

8.8000 77.4400

9.2000 84.6400

9.6000 92.1600

10.0000 100.0000

yA=[94;95;94;91;88;84;77]

yA =

94

95

94

91

88

84

77

lmA=LinearModel.fit(XA,yA)

lmA =

Linear regression model:

y ~ 1 + x1 + x2

Estimated Coefficients:

Estimate SE tStat pValue

(Intercept) -154.8 27.131 -5.7056 0.004665

x1 63.263 6.3015 10.039 0.00055354

x2 -4.0057 0.3628 -11.041 0.00038256

Number of observations: 7, Error degrees of freedom: 4


Root Mean Squared Error: 0.613

R-squared: 0.994, Adjusted R-Squared 0.991

F-statistic vs. constant model: 343, p-value = 3.35e-05

anova(lmA)

ans =

SumSq DF MeanSq F pValue

x1 37.933 1 37.933 100.79 0.00055354

x2 45.883 1 45.883 121.91 0.00038256

Error 1.5055 4 0.37637

anova(lmA,'Components', 1)

ans =

SumSq DF MeanSq F pValue

x1 212.61 1 212.61 564.9 1.8582e-05

x2 45.883 1 45.883 121.91 0.00038256

Error 1.5055 4 0.37637

anova(lmA,'Components', 2)

ans =

SumSq DF MeanSq F pValue

x1 37.933 1 37.933 100.79 0.00055354

x2 45.883 1 45.883 121.91 0.00038256

Error 1.5055 4 0.37637

anova(lmA,'Components', 3)

ans =

SumSq DF MeanSq F pValue

x1 37.933 1 37.933 100.79 0.00055354

x2 45.883 1 45.883 121.91 0.00038256

Error 1.5055 4 0.37637

Para la otra repeticin


anova(lmA1)

ans =

SumSq DF MeanSq F pValue

x1 32.486 1 32.486 19.106 0.011958

x2 40.983 1 40.983 24.103 0.0079895

Error 6.8013 4 1.7003

anova(lmA1,'Components', 1)

ans =

SumSq DF MeanSq F pValue

x1 278.3 1 278.3 163.68 0.00021513

x2 40.983 1 40.983 24.103 0.0079895

Error 6.8013 4 1.7003

anova(lmA1,'Components', 2)

ans =

SumSq DF MeanSq F pValue

x1 32.486 1 32.486 19.106 0.011958

x2 40.983 1 40.983 24.103 0.0079895

Error 6.8013 4 1.7003

anova(lmA1,'Components', 3)

ans =

SumSq DF MeanSq F pValue

x1 32.486 1 32.486 19.106 0.011958

x2 40.983 1 40.983 24.103 0.0079895

Error 6.8013 4 1.7003

lmA1=LinearModel.fit(XA,yA1)

lmA1 =

Linear regression model:

y ~ 1 + x1 + x2

Estimated Coefficients:
Estimate SE tStat pValue

(Intercept) -131.52 57.667 -2.2807 0.084719

x1 58.545 13.394 4.371 0.011958

x2 -3.7858 0.77111 -4.9095 0.0079895

Number of observations: 7, Error degrees of freedom: 4

Root Mean Squared Error: 1.3

R-squared: 0.979, Adjusted R-Squared 0.969

F-statistic vs. constant model: 93.9, p-value = 0.000435

PARA EL OTRO MODELO

lmB=LinearModel.fit(XB,yB)

lmB =

Linear regression model:

y ~ 1 + x1 + x2

Estimated Coefficients:

Estimate SE tStat pValue

(Intercept) 39.873 3.8654 10.315 0.0019431

x1 87.06 15.105 5.7636 0.01038

x2 -34.946 12.23 -2.8573 0.064718

Number of observations: 6, Error degrees of freedom: 3

Root Mean Squared Error: 2.99

R-squared: 0.982, Adjusted R-Squared 0.971

F-statistic vs. constant model: 83.8, p-value = 0.00233

anova(lmB,'Components', 1)

ans =

SumSq DF MeanSq F pValue

x1 1425.3 1 1425.3 159.52 0.0010703

x2 72.95 1 72.95 8.1644 0.064718

Error 26.805 3 8.9351

anova(lmB,'Components', 2)
ans =

SumSq DF MeanSq F pValue

x1 296.82 1 296.82 33.219 0.01038

x2 72.95 1 72.95 8.1644 0.064718

Error 26.805 3 8.9351

anova(lmB,'Components', 3)

ans =

SumSq DF MeanSq F pValue

x1 296.82 1 296.82 33.219 0.01038

x2 72.95 1 72.95 8.1644 0.064718

Error 26.805 3 8.9351

lmB1=LinearModel.fit(XB,yB1)

lmB1 =

Linear regression model:

y ~ 1 + x1 + x2

Estimated Coefficients:

Estimate SE tStat pValue

(Intercept) 44.334 3.1053 14.277 0.00074469

x1 84.99 12.135 7.0038 0.0059771

x2 -41.268 9.8255 -4.2001 0.024631

Number of observations: 6, Error degrees of freedom: 3

Root Mean Squared Error: 2.4

R-squared: 0.983, Adjusted R-Squared 0.971

F-statistic vs. constant model: 85.2, p-value = 0.00228

anova(lmB1,'Components', 1)

ans =

SumSq DF MeanSq F pValue

x1 880.61 1 880.61 152.71 0.0011417

x2 101.73 1 101.73 17.641 0.024631

Error 17.3 3 5.7667


anova(lmB1,'Components', 2)

ans =

SumSq DF MeanSq F pValue

x1 282.87 1 282.87 49.053 0.0059771

x2 101.73 1 101.73 17.641 0.024631

Error 17.3 3 5.7667

anova(lmB1,'Components', 3)

ans =

SumSq DF MeanSq F pValue

x1 282.87 1 282.87 49.053 0.0059771

x2 101.73 1 101.73 17.641 0.024631

Error 17.3 3 5.7667

PARA A)

CON Y
CON Y1
PARA B)

CON Y
CON Y1

Você também pode gostar