Download - Regression with Mathematica
In[2]:= << Statistics`LinearRegression`
In[19]:= << Graphics`MultipleListPlot`
Page 387
ü 1.
ü A
In[27]:= data = 880, 0<, 84, 2<, 86, 3<, 88, 4<, 812, 6<, 814, 7<, 816, 8<, 822, 11<, 826, 11<<;
In[28]:= dplot = ListPlot@dataD;
5 10 15 20 25
2
4
6
8
10
In[29]:= func = Fit@data, 81, x<, xD
Out[29]= 0.361111 + 0.451389 x
In[30]:= regress = Regress@data, 81, x<, xD
Out[30]= 9ParameterTable →
Estimate SE TStat PValue1 0.361111 0.33646 1.07327 0.318751
x 0.451389 0.0233293 19.3486 2.45583 × 10−7,
RSquared → 0.981645, AdjustedRSquared → 0.979023, EstimatedVariance → 0.313492,
ANOVATable →
DF SumOfSq MeanSq FRatio PValue
Model 1 117.361 117.361 374.367 2.45583 × 10−7
Error 7 2.19444 0.313492Total 8 119.556
=
In[31]:= regress = Regress@data, 81, x<, x, RegressionReport →
8FitResiduals, SinglePredictionCITable, ParameterConfidenceRegion<D;
In[36]:= 8observed, predicted, se, ci< = Transpose@HSinglePredictionCITable ê. regressL@@1DDD;
regression.nb 1
In[37]:= Hxval = Map@First, dataD;predicted = Transpose@8xval, predicted<D;lowerCI = Transpose@8xval, Map@First, ciD<D;upperCI = Transpose@8xval, Map@Last, ciD<DL;
In[38]:= MultipleListPlot@data, predicted, lowerCI, upperCI,SymbolShape → 8PlotSymbol@DiamondD, None, None, None<,PlotJoined → 8False, True, True, True<,PlotStyle → 8Automatic, Automatic, [email protected], .05<D, [email protected], .05<D<D
5 10 15 20 25
2
4
6
8
10
12
14
Out[38]= Graphics
ü B
In[39]:= data = 880, 0<, 84, 2<, 86, 4<, 88, 3<, 812, 7<, 814, 6<, 816, 8<, 822, 11<, 826, 13<<;
In[40]:= dplot = ListPlot@dataD;
5 10 15 20 25
2
4
6
8
10
12
In[41]:= func = Fit@data, 81, x<, xD
Out[41]= 0.0833333 + 0.493056 x
regression.nb 2
In[42]:= regress = Regress@data, 81, x<, xD
Out[42]= 9ParameterTable →
Estimate SE TStat PValue1 0.0833333 0.452677 0.18409 0.859162
x 0.493056 0.0313875 15.7087 1.02564 × 10−6,
RSquared → 0.972415, AdjustedRSquared → 0.968474, EstimatedVariance → 0.56746,
ANOVATable →
DF SumOfSq MeanSq FRatio PValue
Model 1 140.028 140.028 246.762 1.02564 × 10−6
Error 7 3.97222 0.56746Total 8 144.
=
In[43]:= regress = Regress@data, 81, x<, x, RegressionReport →
8FitResiduals, SinglePredictionCITable, ParameterConfidenceRegion<D;
In[44]:= 8observed, predicted, se, ci< = Transpose@HSinglePredictionCITable ê. regressL@@1DDD;
In[45]:= Hxval = Map@First, dataD;predicted = Transpose@8xval, predicted<D;lowerCI = Transpose@8xval, Map@First, ciD<D;upperCI = Transpose@8xval, Map@Last, ciD<DL;
In[46]:= MultipleListPlot@data, predicted, lowerCI, upperCI,SymbolShape → 8PlotSymbol@DiamondD, None, None, None<,PlotJoined → 8False, True, True, True<,PlotStyle → 8Automatic, Automatic, [email protected], .05<D, [email protected], .05<D<D
5 10 15 20 25
2.5
5
7.5
10
12.5
15
Out[46]= Graphics
ü C
In[47]:= data = 880, 2<, 84, 8<, 86, 0<, 88, 6<, 812, 3<, 814, 4<, 816, 13<, 822, 7<, 826, 11<<;
regression.nb 3
In[48]:= dplot = ListPlot@dataD;
5 10 15 20 25
2
4
6
8
10
12
In[49]:= func = Fit@data, 81, x<, xD
Out[49]= 2.41667 + 0.298611 x
In[50]:= regress = Regress@data, 81, x<, xD
Out[50]= 9ParameterTable →
Estimate SE TStat PValue1 2.41667 2.18609 1.10547 0.305495x 0.298611 0.151578 1.97002 0.0894892
,
RSquared → 0.356674, AdjustedRSquared → 0.264771, EstimatedVariance → 13.2341,
ANOVATable →
DF SumOfSq MeanSq FRatio PValueModel 1 51.3611 51.3611 3.88096 0.0894892Error 7 92.6389 13.2341Total 8 144.
=
In[51]:= regress = Regress@data, 81, x<, x, RegressionReport →
8FitResiduals, SinglePredictionCITable, ParameterConfidenceRegion<D;
In[52]:= 8observed, predicted, se, ci< = Transpose@HSinglePredictionCITable ê. regressL@@1DDD;
In[53]:= Hxval = Map@First, dataD;predicted = Transpose@8xval, predicted<D;lowerCI = Transpose@8xval, Map@First, ciD<D;upperCI = Transpose@8xval, Map@Last, ciD<DL;
regression.nb 4
In[54]:= MultipleListPlot@data, predicted, lowerCI, upperCI,SymbolShape → 8PlotSymbol@DiamondD, None, None, None<,PlotJoined → 8False, True, True, True<,PlotStyle → 8Automatic, Automatic, [email protected], .05<D, [email protected], .05<D<D
5 10 15 20 25
-5
5
10
15
20
Out[54]= Graphics
ü D
In[56]:= data = 880, 4<, 84, 3<, 86, 8<, 88, 6<, 812, 7<, 814, 13<, 816, 2<, 822, 11<, 836, 0<<;
In[57]:= dplot = ListPlot@dataD;
5 10 15 20 25 30 35
2
4
6
8
10
12
In[58]:= func = Fit@data, 81, x<, xD
Out[58]= 6.83255 − 0.0634995 x
In[59]:= regress = Regress@data, 81, x<, xD
Out[59]= 9ParameterTable →
Estimate SE TStat PValue1 6.83255 2.42255 2.8204 0.0257584x −0.0634995 0.145586 −0.436166 0.675852
,
RSquared → 0.0264581, AdjustedRSquared → −0.112619, EstimatedVariance → 20.0271,
ANOVATable →
DF SumOfSq MeanSq FRatio PValueModel 1 3.80997 3.80997 0.19024 0.675852Error 7 140.19 20.0271Total 8 144.
=
regression.nb 5
In[60]:= regress = Regress@data, 81, x<, x, RegressionReport →
8FitResiduals, SinglePredictionCITable, ParameterConfidenceRegion<D;
In[61]:= 8observed, predicted, se, ci< = Transpose@HSinglePredictionCITable ê. regressL@@1DDD;
In[62]:= Hxval = Map@First, dataD;predicted = Transpose@8xval, predicted<D;lowerCI = Transpose@8xval, Map@First, ciD<D;upperCI = Transpose@8xval, Map@Last, ciD<DL;
In[63]:= MultipleListPlot@data, predicted, lowerCI, upperCI,SymbolShape → 8PlotSymbol@DiamondD, None, None, None<,PlotJoined → 8False, True, True, True<,PlotStyle → 8Automatic, Automatic, [email protected], .05<D, [email protected], .05<D<D
5 10 15 20 25 30 35
-5
5
10
15
Out[63]= Graphics
ü E
In[64]:= data = 880, 8<, 84, 7<, 86, 6<, 88, 13<, 812, 0<, 814, 2<, 816, 11<, 822, 3<, 826, 4<<;
In[65]:= dplot = ListPlot@dataD;
5 10 15 20 25
2
4
6
8
10
12
In[66]:= func = Fit@data, 81, x<, xD
Out[66]= 8.20833 − 0.184028 x
regression.nb 6
In[67]:= regress = Regress@data, 81, x<, xD
Out[67]= 9ParameterTable →
Estimate SE TStat PValue1 8.20833 2.53422 3.239 0.0142728x −0.184028 0.175716 −1.0473 0.329771
,
RSquared → 0.135465, AdjustedRSquared → 0.0119599, EstimatedVariance → 17.7847,
ANOVATable →
DF SumOfSq MeanSq FRatio PValueModel 1 19.5069 19.5069 1.09684 0.329771Error 7 124.493 17.7847Total 8 144.
=
In[68]:= regress = Regress@data, 81, x<, x, RegressionReport →
8FitResiduals, SinglePredictionCITable, ParameterConfidenceRegion<D;
In[69]:= 8observed, predicted, se, ci< = Transpose@HSinglePredictionCITable ê. regressL@@1DDD;
In[70]:= Hxval = Map@First, dataD;predicted = Transpose@8xval, predicted<D;lowerCI = Transpose@8xval, Map@First, ciD<D;upperCI = Transpose@8xval, Map@Last, ciD<DL;
In[71]:= MultipleListPlot@data, predicted, lowerCI, upperCI,SymbolShape → 8PlotSymbol@DiamondD, None, None, None<,PlotJoined → 8False, True, True, True<,PlotStyle → 8Automatic, Automatic, [email protected], .05<D, [email protected], .05<D<D
5 10 15 20 25
-5
5
10
15
20
Out[71]= Graphics
ü F
In[72]:= data = 880, 12<, 84, 13<, 86, 8<, 88, 4<, 812, 7<, 814, 6<, 816, 3<, 822, 2<, 826, 0<<;
regression.nb 7
In[73]:= dplot = ListPlot@dataD;
5 10 15 20 25
2
4
6
8
10
12
In[74]:= func = Fit@data, 81, x<, xD
Out[74]= 11.6944 − 0.465278 x
In[75]:= regress = Regress@data, 81, x<, xD
Out[75]= 9ParameterTable →
Estimate SE TStat PValue1 11.6944 1.24806 9.37011 0.0000327972x −0.465278 0.0865373 −5.37662 0.00103413
,
RSquared → 0.805057, AdjustedRSquared → 0.777208, EstimatedVariance → 4.31349,
ANOVATable →
DF SumOfSq MeanSq FRatio PValueModel 1 124.694 124.694 28.908 0.00103413Error 7 30.1944 4.31349Total 8 154.889
=
In[76]:= regress = Regress@data, 81, x<, x, RegressionReport →
8FitResiduals, SinglePredictionCITable, ParameterConfidenceRegion<D;
In[77]:= 8observed, predicted, se, ci< = Transpose@HSinglePredictionCITable ê. regressL@@1DDD;
In[78]:= Hxval = Map@First, dataD;predicted = Transpose@8xval, predicted<D;lowerCI = Transpose@8xval, Map@First, ciD<D;upperCI = Transpose@8xval, Map@Last, ciD<DL;
regression.nb 8
In[79]:= MultipleListPlot@data, predicted, lowerCI, upperCI,SymbolShape → 8PlotSymbol@DiamondD, None, None, None<,PlotJoined → 8False, True, True, True<,PlotStyle → 8Automatic, Automatic, [email protected], .05<D, [email protected], .05<D<D
5 10 15 20 25
-5
5
10
15
Out[79]= Graphics
ü 2
In[88]:= data = 8832, 90<, 848, 105<, 864, 112.5<, 880, 105<, 896, 90<<;
In[90]:= dplot = ListPlot@dataD;
40 50 60 70 80 90
95
100
105
110
In[91]:= func = Fit@data, 81, x<, xD
Out[91]= 100.5 + 1.26353 × 10−16 x
regression.nb 9
In[92]:= regress = Regress@data, 81, x<, xDDesignedRegress::badfit : Warning: unable to find a fit that is better than the mean response.
Out[92]= 9ParameterTable →
Estimate SE TStat PValue1 100.5 15.5885 6.44708 0.00756816
x 2.64775 × 10−16 0.22964 1.153 × 10−15 1,
RSquared → $Failed, AdjustedRSquared → $Failed, EstimatedVariance → 135.,
ANOVATable →
DF SumOfSq MeanSqError 3 405. 135.Total 4 405.
=
همبستگي خطي ندارند
ü 3
In[93]:= data = 8820, 22<, 822, 24<, 821, 23<, 818, 20<, 819, 21<, 827, 29<<;
In[94]:= dplot = ListPlot@dataD;
20 22 24 26
22
24
26
28
In[95]:= func = Fit@data, 81, x<, xD
Out[95]= 2. + 1. x
In[96]:= regress = Regress@data, 81, x<, xD
Out[96]= 9ParameterTable →
Estimate SE TStat PValue
1 2. 2.86665 × 10−14 6.97677 × 1013 0.
x 1. 1.3417 × 10−15 7.45324 × 1014 0.
,
RSquared → 1., AdjustedRSquared → 1., EstimatedVariance → 9.15079 × 10−29, ANOVATable →
DF SumOfSq MeanSq FRatio PValue
Model 1 50.8333 50.8333 5.55508 × 1029 0.
Error 4 3.66031 × 10−28 9.15079 × 10−29
Total 5 50.8333
=
In[97]:= regress = Regress@data, 81, x<, x, RegressionReport →
8FitResiduals, SinglePredictionCITable, ParameterConfidenceRegion<D;
In[98]:= 8observed, predicted, se, ci< = Transpose@HSinglePredictionCITable ê. regressL@@1DDD;
regression.nb 10
In[99]:= Hxval = Map@First, dataD;predicted = Transpose@8xval, predicted<D;lowerCI = Transpose@8xval, Map@First, ciD<D;upperCI = Transpose@8xval, Map@Last, ciD<DL;
In[100]:=
MultipleListPlot@data, predicted, lowerCI, upperCI,SymbolShape → 8PlotSymbol@DiamondD, None, None, None<,PlotJoined → 8False, True, True, True<,PlotStyle → 8Automatic, Automatic, [email protected], .05<D, [email protected], .05<D<D
20 22 24 26
22
24
26
28
Out[100]=
Graphics
ü 4
In[101]:=
data = 88−4, 0.5<, 8−4, −.6<, 8−3, −.5<, 83, .5<, 84, .5<, 84, −.6<<;
In[102]:=
dplot = ListPlot@dataD;
-4 -2 2 4
-0.6
-0.4
-0.2
0.2
0.4
In[103]:=
func = Fit@data, 81, x<, xDOut[103]=
−0.0333333 + 0.0365854 x
regression.nb 11
In[104]:=
regress = Regress@data, 81, x<, xDOut[104]=
9ParameterTable →
Estimate SE TStat PValue1 −0.0333333 0.258487 −0.128955 0.903617x 0.0365854 0.0699211 0.523238 0.628456
,
RSquared → 0.06406, AdjustedRSquared → −0.169925, EstimatedVariance → 0.400894,
ANOVATable →
DF SumOfSq MeanSq FRatio PValueModel 1 0.109756 0.109756 0.273778 0.628456Error 4 1.60358 0.400894Total 5 1.71333
=
In[105]:=
regress = Regress@data, 81, x<, x, RegressionReport →
8FitResiduals, SinglePredictionCITable, ParameterConfidenceRegion<D;
In[106]:=
8observed, predicted, se, ci< = Transpose@HSinglePredictionCITable ê. regressL@@1DDD;
In[107]:=
Hxval = Map@First, dataD;predicted = Transpose@8xval, predicted<D;lowerCI = Transpose@8xval, Map@First, ciD<D;upperCI = Transpose@8xval, Map@Last, ciD<DL;
In[108]:=
MultipleListPlot@data, predicted, lowerCI, upperCI,SymbolShape → 8PlotSymbol@DiamondD, None, None, None<,PlotJoined → 8False, True, True, True<,PlotStyle → 8Automatic, Automatic, [email protected], .05<D, [email protected], .05<D<D
-4 -2 2 4
-2
-1
1
2
Out[108]=
Graphics
regression.nb 12
ü B
In[109]:=
data = data ê. 8x_, y_< → 9 x
10, 10 y=
Out[109]=
99−25
, 5.=, 9−25
, −6.=, 9−3
10, −5.=, 9 3
10, 5.=, 9 2
5, 5.=, 9 2
5, −6.==
In[110]:=
dplot = ListPlot@dataD;
-0.4 -0.2 0.2 0.4
-6
-4
-2
2
4
In[111]:=
func = Fit@data, 81, x<, xDOut[111]=
−0.333333 + 3.65854 x
In[112]:=
regress = Regress@data, 81, x<, xDOut[112]=
9ParameterTable →
Estimate SE TStat PValue1 −0.333333 2.58487 −0.128955 0.903617x 3.65854 6.99211 0.523238 0.628456
,
RSquared → 0.06406, AdjustedRSquared → −0.169925, EstimatedVariance → 40.0894,
ANOVATable →
DF SumOfSq MeanSq FRatio PValueModel 1 10.9756 10.9756 0.273778 0.628456Error 4 160.358 40.0894Total 5 171.333
=
In[113]:=
regress = Regress@data, 81, x<, x, RegressionReport →
8FitResiduals, SinglePredictionCITable, ParameterConfidenceRegion<D;
In[114]:=
8observed, predicted, se, ci< = Transpose@HSinglePredictionCITable ê. regressL@@1DDD;
regression.nb 13
In[115]:=
Hxval = Map@First, dataD;predicted = Transpose@8xval, predicted<D;lowerCI = Transpose@8xval, Map@First, ciD<D;upperCI = Transpose@8xval, Map@Last, ciD<DL;
In[116]:=
MultipleListPlot@data, predicted, lowerCI, upperCI,SymbolShape → 8PlotSymbol@DiamondD, None, None, None<,PlotJoined → 8False, True, True, True<,PlotStyle → 8Automatic, Automatic, [email protected], .05<D, [email protected], .05<D<D
-0.4 -0.2 0.2 0.4
-20
-10
10
20
Out[116]=
Graphics
ü C
r1=0.06405997912119195`r2 =0.06405997912119195`
به داده ها تغيير هماهنگ طور آرده اند
ü 5
ü A
In[131]:=
data = 881.30, 0.11<, 82.40, .38<,82.60, .41<, 82.80, .45<, 82.40, .39<, 83.00, .48<, 84.10, .61<<;
regression.nb 14
In[132]:=
dplot = ListPlot@dataD;
1.5 2.5 3 3.5 4
0.2
0.3
0.4
0.5
0.6
In[133]:=
func = Fit@data, 81, x<, xDOut[133]=
−0.063111 + 0.175902 x
In[134]:=
regress = Regress@data, 81, x<, xDOut[134]=
9ParameterTable →
Estimate SE TStat PValue1 −0.063111 0.0530339 −1.19001 0.28746x 0.175902 0.0191619 9.17977 0.000257308
,
RSquared → 0.943989, AdjustedRSquared → 0.932787, EstimatedVariance → 0.0015411,
ANOVATable →
DF SumOfSq MeanSq FRatio PValueModel 1 0.129866 0.129866 84.2682 0.000257308Error 5 0.00770551 0.0015411Total 6 0.137571
=
In[135]:=
regress = Regress@data, 81, x<, x, RegressionReport →
8FitResiduals, SinglePredictionCITable, ParameterConfidenceRegion<D;
In[136]:=
8observed, predicted, se, ci< = Transpose@HSinglePredictionCITable ê. regressL@@1DDD;
In[137]:=
Hxval = Map@First, dataD;predicted = Transpose@8xval, predicted<D;lowerCI = Transpose@8xval, Map@First, ciD<D;upperCI = Transpose@8xval, Map@Last, ciD<DL;
regression.nb 15
In[138]:=
MultipleListPlot@data, predicted, lowerCI, upperCI,SymbolShape → 8PlotSymbol@DiamondD, None, None, None<,PlotJoined → 8False, True, True, True<,PlotStyle → 8Automatic, Automatic, [email protected], .05<D, [email protected], .05<D<D
1.5 2.5 3 3.5 4
0.2
0.4
0.6
0.8
Out[138]=
Graphics
ü B
In[139]:=
data = data ê. 8x_, y_< → 8x2, y<Out[139]=
881.69, 0.11<, 85.76, 0.38<, 86.76, 0.41<,87.84, 0.45<, 85.76, 0.39<, 89., 0.48<, 816.81, 0.61<<
In[140]:=
dplot = ListPlot@dataD;
4 6 8 10 12 14 16
0.2
0.3
0.4
0.5
0.6
In[141]:=
func = Fit@data, 81, x<, xDOut[141]=
0.178021 + 0.0295385 x
regression.nb 16
In[142]:=
regress = Regress@data, 81, x<, xDOut[142]=
9ParameterTable →
Estimate SE TStat PValue1 0.178021 0.0544383 3.27015 0.0221949x 0.0295385 0.00619835 4.76553 0.00503469
,
RSquared → 0.819562, AdjustedRSquared → 0.783474, EstimatedVariance → 0.00496463,
ANOVATable →
DF SumOfSq MeanSq FRatio PValueModel 1 0.112748 0.112748 22.7103 0.00503469Error 5 0.0248232 0.00496463Total 6 0.137571
=
In[143]:=
regress = Regress@data, 81, x<, x, RegressionReport →
8FitResiduals, SinglePredictionCITable, ParameterConfidenceRegion<D;
In[144]:=
8observed, predicted, se, ci< = Transpose@HSinglePredictionCITable ê. regressL@@1DDD;
In[145]:=
Hxval = Map@First, dataD;predicted = Transpose@8xval, predicted<D;lowerCI = Transpose@8xval, Map@First, ciD<D;upperCI = Transpose@8xval, Map@Last, ciD<DL;
In[146]:=
MultipleListPlot@data, predicted, lowerCI, upperCI,SymbolShape → 8PlotSymbol@DiamondD, None, None, None<,PlotJoined → 8False, True, True, True<,PlotStyle → 8Automatic, Automatic, [email protected], .05<D, [email protected], .05<D<D
2.5 5 7.5 10 12.5 15
0.2
0.4
0.6
0.8
Out[146]=
Graphics
regression.nb 17
ü C
In[148]:=
data = data ê. 8x_, y_< → 8Log@xD, y<Out[148]=
880.262364, 0.11<, 80.875469, 0.38<, 80.955511, 0.41<,81.02962, 0.45<, 80.875469, 0.39<, 81.09861, 0.48<, 81.41099, 0.61<<
In[149]:=
dplot = ListPlot@dataD;
0.4 0.6 0.8 1.2 1.4
0.2
0.3
0.4
0.5
0.6
In[150]:=
func = Fit@data, 81, x<, xDOut[150]=
−0.00130688 + 0.436253 x
In[151]:=
regress = Regress@data, 81, x<, xDOut[151]=
9ParameterTable →
Estimate SE TStat PValue1 −0.00130688 0.00645851 −0.202349 0.847619
x 0.436253 0.006566 66.4412 1.46239 × 10−8,
RSquared → 0.998869, AdjustedRSquared → 0.998642,EstimatedVariance → 0.0000311288, ANOVATable →
DF SumOfSq MeanSq FRatio PValue
Model 1 0.137416 0.137416 4414.43 1.46239 × 10−8
Error 5 0.000155644 0.0000311288Total 6 0.137571
=
In[152]:=
regress = Regress@data, 81, x<, x, RegressionReport →
8FitResiduals, SinglePredictionCITable, ParameterConfidenceRegion<D;
In[153]:=
8observed, predicted, se, ci< = Transpose@HSinglePredictionCITable ê. regressL@@1DDD;
regression.nb 18
In[154]:=
Hxval = Map@First, dataD;predicted = Transpose@8xval, predicted<D;lowerCI = Transpose@8xval, Map@First, ciD<D;upperCI = Transpose@8xval, Map@Last, ciD<DL;
In[155]:=
MultipleListPlot@data, predicted, lowerCI, upperCI,SymbolShape → 8PlotSymbol@DiamondD, None, None, None<,PlotJoined → 8False, True, True, True<,PlotStyle → 8Automatic, Automatic, [email protected], .05<D, [email protected], .05<D<D
0.6 0.8 1.2 1.4
0.1
0.2
0.3
0.4
0.5
0.6
Out[155]=
Graphics
ü D
In[157]:=
data = data ê. 8x_, y_< → 9è!!!!x , y=
Out[157]=
881.14018, 0.11<, 81.54919, 0.38<, 81.61245, 0.41<,81.67332, 0.45<, 81.54919, 0.39<, 81.73205, 0.48<, 82.02485, 0.61<<
In[158]:=
dplot = ListPlot@dataD;
1.2 1.4 1.6 1.8
0.2
0.3
0.4
0.5
0.6
regression.nb 19
In[159]:=
func = Fit@data, 81, x<, xDOut[159]=
−0.511247 + 0.568088 x
In[160]:=
regress = Regress@data, 81, x<, xDOut[160]=
9ParameterTable →
Estimate SE TStat PValue1 −0.511247 0.0541346 −9.44399 0.00022476x 0.568088 0.0332099 17.106 0.0000124966
,
RSquared → 0.9832, AdjustedRSquared → 0.97984,EstimatedVariance → 0.000462247, ANOVATable →
DF SumOfSq MeanSq FRatio PValueModel 1 0.13526 0.13526 292.614 0.0000124966Error 5 0.00231124 0.000462247Total 6 0.137571
=
In[161]:=
regress = Regress@data, 81, x<, x, RegressionReport →
8FitResiduals, SinglePredictionCITable, ParameterConfidenceRegion<D;
In[162]:=
8observed, predicted, se, ci< = Transpose@HSinglePredictionCITable ê. regressL@@1DDD;
In[163]:=
Hxval = Map@First, dataD;predicted = Transpose@8xval, predicted<D;lowerCI = Transpose@8xval, Map@First, ciD<D;upperCI = Transpose@8xval, Map@Last, ciD<DL;
In[164]:=
MultipleListPlot@data, predicted, lowerCI, upperCI,SymbolShape → 8PlotSymbol@DiamondD, None, None, None<,PlotJoined → 8False, True, True, True<,PlotStyle → 8Automatic, Automatic, [email protected], .05<D, [email protected], .05<D<D
1.2 1.4 1.6 1.8
0.1
0.2
0.3
0.4
0.5
0.6
0.7
Out[164]=
Graphics
regression.nb 20
ü E
In[166]:=
data = data ê. 8x_, y_< → 9 1
x, y=
Out[166]=
880.769231, 0.11<, 80.416667, 0.38<, 80.384615, 0.41<,80.357143, 0.45<, 80.416667, 0.39<, 80.333333, 0.48<, 80.243902, 0.61<<
In[167]:=
dplot = ListPlot@dataD;
0.4 0.5 0.6 0.7
0.2
0.3
0.4
0.5
0.6
In[168]:=
func = Fit@data, 81, x<, xDOut[168]=
0.778439 − 0.896463 x
In[169]:=
regress = Regress@data, 81, x<, xDOut[169]=
9ParameterTable →
Estimate SE TStat PValue
1 0.778439 0.0325635 23.9053 2.38631 × 10−6
x −0.896463 0.0732069 −12.2456 0.0000642482,
RSquared → 0.967733, AdjustedRSquared → 0.961279,EstimatedVariance → 0.000887815, ANOVATable →
DF SumOfSq MeanSq FRatio PValueModel 1 0.133132 0.133132 149.955 0.0000642482Error 5 0.00443908 0.000887815Total 6 0.137571
=
In[170]:=
regress = Regress@data, 81, x<, x, RegressionReport →
8FitResiduals, SinglePredictionCITable, ParameterConfidenceRegion<D;
In[171]:=
8observed, predicted, se, ci< = Transpose@HSinglePredictionCITable ê. regressL@@1DDD;
regression.nb 21
In[172]:=
Hxval = Map@First, dataD;predicted = Transpose@8xval, predicted<D;lowerCI = Transpose@8xval, Map@First, ciD<D;upperCI = Transpose@8xval, Map@Last, ciD<DL;
In[173]:=
MultipleListPlot@data, predicted, lowerCI, upperCI,SymbolShape → 8PlotSymbol@DiamondD, None, None, None<,PlotJoined → 8False, True, True, True<,PlotStyle → 8Automatic, Automatic, [email protected], .05<D, [email protected], .05<D<D
0.25 0.35 0.4 0.45 0.5
0.1
0.2
0.3
0.4
0.5
0.6
Out[173]=
Graphics
Page 406
ü 7
In[175]:=
data = 881, 8.1<, 81.1, 7.5<, 81.2, 8.5<, 81.3, 9.5<, 81.4, 9.5<,81.5, 8.9<, 81.6, 8.6<, 81.7, 10.2<, 81.8, 9.3<, 81.9, 9.1<, 82, 10.5<<;
regression.nb 22
ü A
In[167]:=
dplot = ListPlot@dataD;
0.4 0.5 0.6 0.7
0.2
0.3
0.4
0.5
0.6
ü B
In[168]:=
func = Fit@data, 81, x<, xDOut[168]=
0.778439 − 0.896463 x
ü C
a = 0.778438553758127`b = −0.8964633841626545`
ü D
In[176]:=
0.778438553758127` − 0.8964633841626545` x ê. x → 1.75
Out[176]=
−0.790372
regression.nb 23
ü E & F
In[177]:=
regress = Regress@data, 81, x<, xDOut[177]=
9ParameterTable →
Estimate SE TStat PValue1 6.15909 0.924545 6.66176 0.0000924862x 1.93636 0.603106 3.21065 0.0106478
,
RSquared → 0.533879, AdjustedRSquared → 0.482087, EstimatedVariance → 0.400111,
ANOVATable →
DF SumOfSq MeanSq FRatio PValueModel 1 4.12445 4.12445 10.3083 0.0106478Error 9 3.601 0.400111Total 10 7.72545
=
In[178]:=
regress = Regress@data, 81, x<, x, RegressionReport →
8FitResiduals, SinglePredictionCITable, ParameterConfidenceRegion<D;
In[179]:=
8observed, predicted, se, ci< = Transpose@HSinglePredictionCITable ê. regressL@@1DDD;
In[180]:=
Hxval = Map@First, dataD;predicted = Transpose@8xval, predicted<D;lowerCI = Transpose@8xval, Map@First, ciD<D;upperCI = Transpose@8xval, Map@Last, ciD<DL;
In[181]:=
MultipleListPlot@data, predicted, lowerCI, upperCI,SymbolShape → 8PlotSymbol@DiamondD, None, None, None<,PlotJoined → 8False, True, True, True<,PlotStyle → 8Automatic, Automatic, [email protected], .05<D, [email protected], .05<D<D
1.2 1.4 1.6 1.8 2
8
9
10
11
Out[181]=
Graphics
regression.nb 24
ü 8
In[182]:=
data = 880, 8 + 5 + 8<, 815, 12 + 10 + 14<,830, 25 + 21 + 24<, 845, 31 + 33 + 28<, 860, 44 + 39 + 42<, 875, 48 + 51 + 44<<;
In[183]:=
dplot = ListPlot@dataD;
10 20 30 40 50 60 70
40
60
80
100
120
140
ü A
In[184]:=
func = Fit@data, 81, x<, xDOut[184]=
16.9524 + 1.71238 x
In[186]:=
pl = Plot@func, 8x, 0, 75<D
10 20 30 40 50 60 70
20
40
60
80
100
120
140
Out[186]=
Graphics
regression.nb 25
ü B
In[187]:=
Show@dplot, plD
10 20 30 40 50 60 70
20
40
60
80
100
120
140
Out[187]=
Graphics
ü C
In[188]:=
func ê. x → 50
Out[188]=
102.571
ü D
In[194]:=
regress = Regress@data, 81, x<, xDOut[194]=
9ParameterTable →
Estimate SE TStat PValue1 16.9524 3.63867 4.65895 0.00959707x 1.71238 0.0801208 21.3725 0.0000283413
,
RSquared → 0.991319, AdjustedRSquared → 0.989149, EstimatedVariance → 25.2762,
ANOVATable →
DF SumOfSq MeanSq FRatio PValueModel 1 11545.7 11545.7 456.783 0.0000283413Error 4 101.105 25.2762Total 5 11646.8
=
In[195]:=
regress = Regress@data, 81, x<, x, RegressionReport →
8FitResiduals, SinglePredictionCITable, ParameterConfidenceRegion<D;
In[196]:=
8observed, predicted, se, ci< = Transpose@HSinglePredictionCITable ê. regressL@@1DDD;
regression.nb 26
In[197]:=
Hxval = Map@First, dataD;predicted = Transpose@8xval, predicted<D;lowerCI = Transpose@8xval, Map@First, ciD<D;upperCI = Transpose@8xval, Map@Last, ciD<DL;
In[198]:=
MultipleListPlot@data, predicted, lowerCI, upperCI,SymbolShape → 8PlotSymbol@DiamondD, None, None, None<,PlotJoined → 8False, True, True, True<,PlotStyle → 8Automatic, Automatic, [email protected], .05<D, [email protected], .05<D<D
10 20 30 40 50 60 70
25
50
75
100
125
150
Out[198]=
Graphics
ü E
In[200]:=
regress = Regress@data, 81, x<, x, RegressionReport → 8AdjustedRSquared<DOut[200]=
8AdjustedRSquared → 0.989149<
ü 11
In[203]:=
data = 881, 0.1<, 82, 0.2<, 83, 0.25<, 84, 0.4<, 85, 0.4<, 86, 0.5<, 87, 1<, 88, 1<<;
رابطه بين ln(x) , -ln(y) خطي است
In[204]:=
data = data ê. 8x_, y_< → 8Log@xD, −Log@yD< êê N
Out[204]=
880., 2.30259<, 80.693147, 1.60944<, 81.09861, 1.38629<, 81.38629, 0.916291<,81.60944, 0.916291<, 81.79176, 0.693147<, 81.94591, 0.<, 82.07944, 0.<<
regression.nb 27
In[205]:=
dplot = ListPlot@dataD;
0.5 1 1.5 2
0.5
1
1.5
2
In[206]:=
func = Fit@data, 81, x<, xDOut[206]=
2.41171 − 1.08157 x
In[207]:=
regress = Regress@data, 81, x<, xDOut[207]=
9ParameterTable →
Estimate SE TStat PValue
1 2.41171 0.168761 14.2907 7.34449 × 10−6
x −1.08157 0.114036 −9.48446 0.0000782631,
RSquared → 0.937471, AdjustedRSquared → 0.927049, EstimatedVariance → 0.0450385,
ANOVATable →
DF SumOfSq MeanSq FRatio PValueModel 1 4.05144 4.05144 89.955 0.0000782631Error 6 0.270231 0.0450385Total 7 4.32167
=
In[208]:=
regress = Regress@data, 81, x<, x, RegressionReport →
8FitResiduals, SinglePredictionCITable, ParameterConfidenceRegion<D;
In[209]:=
8observed, predicted, se, ci< = Transpose@HSinglePredictionCITable ê. regressL@@1DDD;
In[210]:=
Hxval = Map@First, dataD;predicted = Transpose@8xval, predicted<D;lowerCI = Transpose@8xval, Map@First, ciD<D;upperCI = Transpose@8xval, Map@Last, ciD<DL;
regression.nb 28
In[211]:=
MultipleListPlot@data, predicted, lowerCI, upperCI,SymbolShape → 8PlotSymbol@DiamondD, None, None, None<,PlotJoined → 8False, True, True, True<,PlotStyle → 8Automatic, Automatic, [email protected], .05<D, [email protected], .05<D<D
0.5 1 1.5 2-0.5
0.5
1
1.5
2
2.5
3
Out[211]=
Graphics
ü 12
In[212]:=
data = 881280, 5<, 81300, 10<, 81320, 31<, 81340, 31<, 81360, 50<, 81380, 70<<;
In[213]:=
dplot = ListPlot@dataD;
1300 1320 1340 1360 138010
20
30
40
50
60
70
In[214]:=
func = Fit@data, 81, x<, xDOut[214]=
−812.667 + 0.635714 x
regression.nb 29
In[215]:=
regress = Regress@data, 81, x<, xDOut[215]=
9ParameterTable →
Estimate SE TStat PValue1 −812.667 97.3472 −8.34812 0.00112552x 0.635714 0.0731693 8.68827 0.00096606
,
RSquared → 0.949677, AdjustedRSquared → 0.937096, EstimatedVariance → 37.4762,
ANOVATable →
DF SumOfSq MeanSq FRatio PValueModel 1 2828.93 2828.93 75.486 0.00096606Error 4 149.905 37.4762Total 5 2978.83
=
In[216]:=
regress = Regress@data, 81, x<, x, RegressionReport →
8FitResiduals, SinglePredictionCITable, ParameterConfidenceRegion<D;
In[217]:=
8observed, predicted, se, ci< = Transpose@HSinglePredictionCITable ê. regressL@@1DDD;
In[218]:=
Hxval = Map@First, dataD;predicted = Transpose@8xval, predicted<D;lowerCI = Transpose@8xval, Map@First, ciD<D;upperCI = Transpose@8xval, Map@Last, ciD<DL;
In[219]:=
MultipleListPlot@data, predicted, lowerCI, upperCI,SymbolShape → 8PlotSymbol@DiamondD, None, None, None<,PlotJoined → 8False, True, True, True<,PlotStyle → 8Automatic, Automatic, [email protected], .05<D, [email protected], .05<D<D
1300 1320 1340 1360 1380
-20
20
40
60
80
Out[219]=
Graphics
In[220]:=
func ê. x → 1400
Out[220]=
77.3333
regression.nb 30