Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more ➡
Standard view
Full view
of .
×
0 of .
Results for:
P. 1
Regression with Mathematica

# Regression with Mathematica

Ratings: 0|Views: 5,328|Likes:

### Availability:

See More
See less

06/06/2012

pdf

text

original

In[2]:=
<<
Statistics`LinearRegression`
In[19]:=
<<
Graphics`MultipleListPlot`
Page 387
ü
1.
ü
A
In[27]:=
data
=
88
0, 0
<
,
8
4, 2
<
,
8
6, 3
<
,
8
8, 4
<
,
8
12, 6
<
,
8
14, 7
<
,
8
16, 8
<
,
8
22, 11
<
,
8
26, 11
<<
;
In[28]:=
dplot
=
ListPlot
@
data
D
;
5 10 15 20 25246810
In[29]:=
func
=
Fit
@
data,
8
1, x
<
, x
D
Out[29]=
0.361111
+
0.451389x
In[30]:=
regress
=
Regress
@
data,
8
1, x
<
, x
D
Out[30]=
9
ParameterTable
Estimate SE TStat PValue1 0.361111 0.33646 1.07327 0.318751x 0.451389 0.0233293 19.3486 2.45583
×
10
7
,RSquared
0.979023, EstimatedVariance
0.313492,ANOVATable
DF SumOfSq MeanSq FRatio PValueModel 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,
8
1, x
<
, x, RegressionReport
8
FitResiduals, SinglePredictionCITable, ParameterConfidenceRegion
<D
;
In[36]:=
8
observed, predicted, se, ci
<
=
Transpose
@H
SinglePredictionCITable
ê
. regress
L@@
1
DDD
;
regression.nb
1

In[37]:=
H
xval
=
Map
@
First, data
D
; predicted
=
Transpose
@8
xval, predicted
<D
;lowerCI
=
Transpose
@8
xval, Map
@
First, ci
D<D
;upperCI
=
Transpose
@8
xval, Map
@
Last, ci
D<DL
;
In[38]:=
MultipleListPlot
@
data, predicted, lowerCI, upperCI,SymbolShape
8
PlotSymbol
@
Diamond
D
, None, None, None
<
,PlotJoined
8
False, True, True, True
<
,PlotStyle
8
Automatic, Automatic, Dashing
@8
.05, .05
<D
, Dashing
@8
.05, .05
<D<D
5 10 15 20 252468101214
Out[38]=
Graphics
ü
B
In[39]:=
data
=
88
0, 0
<
,
8
4, 2
<
,
8
6, 4
<
,
8
8, 3
<
,
8
12, 7
<
,
8
14, 6
<
,
8
16, 8
<
,
8
22, 11
<
,
8
26, 13
<<
;
In[40]:=
dplot
=
ListPlot
@
data
D
;
5 10 15 20 2524681012
In[41]:=
func
=
Fit
@
data,
8
1, x
<
, x
D
Out[41]=
0.0833333
+
0.493056x
regression.nb
2

In[42]:=
regress
=
Regress
@
data,
8
1, x
<
, x
D
Out[42]=
9
ParameterTable
Estimate SE TStat PValue1 0.0833333 0.452677 0.18409 0.859162x 0.493056 0.0313875 15.7087 1.02564
×
10
6
,RSquared
0.968474, EstimatedVariance
0.56746,ANOVATable
DF SumOfSq MeanSq FRatio PValueModel 1 140.028 140.028 246.762 1.02564
×
10
6
Error 7 3.97222 0.56746Total 8 144.
=
In[43]:=
regress
=
Regress
@
data,
8
1, x
<
, x, RegressionReport
8
FitResiduals, SinglePredictionCITable, ParameterConfidenceRegion
<D
;
In[44]:=
8
observed, predicted, se, ci
<
=
Transpose
@H
SinglePredictionCITable
ê
. regress
L@@
1
DDD
;
In[45]:=
H
xval
=
Map
@
First, data
D
; predicted
=
Transpose
@8
xval, predicted
<D
;lowerCI
=
Transpose
@8
xval, Map
@
First, ci
D<D
;upperCI
=
Transpose
@8
xval, Map
@
Last, ci
D<DL
;
In[46]:=
MultipleListPlot
@
data, predicted, lowerCI, upperCI,SymbolShape
8
PlotSymbol
@
Diamond
D
, None, None, None
<
,PlotJoined
8
False, True, True, True
<
,PlotStyle
8
Automatic, Automatic, Dashing
@8
.05, .05
<D
, Dashing
@8
.05, .05
<D<D
5 10 15 20 252.557.51012.515
Out[46]=
Graphics
ü
C
In[47]:=
data
=
88
0, 2
<
,
8
4, 8
<
,
8
6, 0
<
,
8
8, 6
<
,
8
12, 3
<
,
8
14, 4
<
,
8
16, 13
<
,
8
22, 7
<
,
8
26, 11
<<
;
regression.nb
3

## Activity (6)

### Showing

AllMost RecentReviewsAll NotesLikes
1 hundred reads|over 4 years ago
1 thousand reads|over 3 years ago
d280299 liked this|about 1 year ago
fiifiamp308 liked this|over 3 years ago
slinde liked this|over 3 years ago
xyzaaa5324 liked this|over 3 years ago