A Statistical Analysis Example of A Full Functional Utilization of An

Download Report

Transcript A Statistical Analysis Example of A Full Functional Utilization of An

A Statistical Analysis Example of
A Full Functional Utilization of
An Engineering Calculator
Li-Fei Huang ([email protected])
Dept. of App. Statistics & Info. Sci.
Ming Chuan University, TAIWAN
Outline
•
•
•
•
•
•
•
Introduction
Steps of simple linear regression analysis
Commands for programming
Regression test program
Execution result
Conclusions
References
Introduction
• The functions and commands of statistical
software which is installed in the computer
are quite COMPLICATED.
• The engineering calculator is EASIER to
manipulate and CHEAPER to possess. Today
even the PROGRAMMING can be done.
• This paper will use CASIO fx-7400G PLUS to do
the simple linear regression analysis.
CASIO fx-7400G PLUS
• The slope, the intercept and the coefficient of
correlation are shown directly.
• There are NO further results about hypothesis
testing.
• Lots of basic statistics such as
n, x , y, x 2 , y 2 , xy can be extracted
from the memory of the calculator to create
the program about hypothesis testing.
Simple linear regression (Step 1)
n
• The sum of squares for X: SSX   ( x
• The slope for the regression line:
i 1
i
b1
 x ) 2  n( x 
xy  nx y


SSX
The intercept for the regression line: b0  y  b1 x
n) 2
Simple linear regression (Step 2)
• The sum of squares for regression:
n
SSR    yˆ i  y   b12 SSX
2
i 1
• The sum of squares for Y or the sum of
squares for total: SSY  SST   ( y  y )  n( yn)
• The sum of squares for error: SSE  SST  SSR
• The mean squares for error: MSE  SSE
n2
• The regression F test value: F  SSR 1  SSR
n
2
i 1
2
i
SSE (n  2)
MSE
Simple linear regression (Step 3)
SSR
SST
• The coefficient of determination:
• The coefficient of correlation:
R if X and Y are positively correlated,
 R if X and Y are negatively correlated.
R2 
2
2
Simple linear regression (Step 4)
• The t tests for the slope and the intercept:
t
b1  1
t
b0   0
MSE
MSE  x 2
SSX
nSSX
• The confidence interval and the prediction
interval for a given value of X:
Yˆ  t
2
1 ( X  x)2
MSE

n
SSX
Yˆ  t
2
1 ( X  x)2
MSE 1  
n
SSX
Commands for programming
• Parts of commands from CASIO fx-7400G PLUS
manual:
Basic operation
?
Key-in a value.
Show calculation result.
Connect 2 commands.

:


Program command
Jump command
Display command
If
Then Else
Goto Lbl
"
"
IfEnd
Connect 2 commands.
Store result in A to Z.
An if-then-else loop.
Go to the label.
Show words in quotes.
Regression test program (Step1)

R E G
2
 V
a r i a b l e
s
t
1 , L i s t
T
E

S T
Name the program.
L i
Compute
2 , 1
variables.
basic
statistics of 2

(

x
n

x 
y

B  x

L
i
s
1  B 
s
t
L
i
 L
y  n  x 
n
t
2
y )  (
)  B 
and store it in B.
A 
Store the intercept in A.
A  L i
3 
s t
i s t
2  L i s t
4 
Use basic statistics to find the slope
3
Store Y hats in List 3.
Store residuals in List 4.
Regression test program (Step2)
n  x 
B
2

"
S
S
n

y

T

R
 E
"
S
"
n
 R 
2
R  " : R 
 T
Store sum of squares for regression
in R and show it.

Store SST in T.
S
E  " : E 
Store SSE in E.
Show SSE.
S
S
T
E

(
n  2 )  E
"
M
S
E  " : E 
R

E  F
"
F
 " : F
"
D
F
2
n

 " : T

Show SST.



 1 , " : n  2 
Store mean squares for error in E
and show it.
Store the F test value in F and
show it.
Show 2 degrees of freedom.
Regression test program (Step3)
R
 T
 R 
"
R
I
f
R

" :
E
l
s e
f
E
 " : R 
2
B  0
h e n
"
R 
" R  " : 

I
T
n d

R
Store and show the coefficient of
determination.
Find the coefficient of correlation
and show it.
Regression test program (Step4)
• The t tests for the slope and the intercept:
L
b
l
"
?

(
B

x 
n
" S
L
: T

" B
(
0 : " B
2
)  (
( E
) )  T

T
T
E
T
A 0  " ?  I
A

I
)  (
E
S

n
"
I
N T
:
T

 "
Ask for an intercept to test.

( E  
 x 
n
E
E
2
Ask for a slope to test.
Store the slope t test value in T.
Show the slope t test value.
P
2
E
 n 
O
2
Put label 0 here.
A 1 

S
S
E T
Store the intercept t test value in
x
) )  T
T.

R C
P T
T
"
Show the intercept t test value.
Regression test program (Step4)
• The SE parts of the confidence interval and
the prediction interval for a given value of X:
"
 " ? 
N
E W
X
(
1
 n  (
n

x

"
S
E
G

n
2
( Y

x
)
2

)  G 
H
A T
)  " :
E
( 1  G
S
E
( P
G o t o
0

Compute and show the standard
error for Y hat.
E 
(
"
X
Ask for a new X value.

X
R
E
2
) )  H

D )  " : H
Compute and show the standard
error for the prediction interval.
Go to label 0 and test another
slope.
Execution result
• One data set in the book of Berenson, Levine,
& Krehbiel
No.
1
2
3
4
5
6
7
8
9
10
11
12
X
5
5
5
10
10
10
15
15
15
20
20
20
Y
160
220
140
190
240
260
230
270
280
260
290
310
Execution result (Step 2)
S
S
S
M
F
S
S
S
S
R 
E
T
E
2 0 5 3 5
Press EXE to move on.
9 4 9 0
Press EXE to move on.
3 0 0 2 5
Press EXE to move on.
9 4 9
Press EXE to move on.




D F
2
1 . 6 3 8 5 6 6 9 1

1 ,
1 0
Press EXE to move on.
Press EXE to move on.
Execution result (Step 3)
R
2

0
.
6 8 3 9 3 0 0 5 8 3
Press EXE to move on.
.
8 2 7 0 0 0 6 3 9 8
Press EXE to move on.
R 
0
Execution result (Step 4)
A 1  ?
B E T
0
S
Key-in the number.
L O P E
4
B
T T
E S T
. 6 5 1 7 2 7 3 0 4
A 0  ?
E T
0
I
Key-in the number.
N T
6
N
E W
2
5
S
E
E
E
R C
E
P T
T
. 6 5 6 5 6 0 6 5 8
Press EXE to move on.
 ?
X
Key-in the number.
(
2
S
Press EXE to move on.
(
3
Y
H
A T
) 
1 . 7 8 3 0 2 0 9 1
P R E
Press EXE to move on.
D ) 
7 . 7 2 9 2 9 8 9 6

D i s
p

Press EXE to move on or
press AC to stop program.
Conclusion 1
• This particular calculator can produce some
built in graphs such as histogram, bar chart,
pie chart, line chart, box-and-whisker plot,
standard normal probability density function,
linear regression line, quadratic regression line,
log regression line, exponential regression line
and power regression line.
Conclusion 2
• Using List 4 in previous example, residual plots
can be produced to check whether this data
set is suitable for regression analysis or not.
Conclusion 3
• Using basic statistics, the following tests
besides the regression test can also be fulfilled:
z test, one-sample t test, two-sample t test,
paired t test, chi-square test for single
variance and F test for two variances.
Conclusion 4
• Using the built in permutation and
combination functions, the probability mass
function and cumulative mass function for the
following discrete probability distributions can
be found: binomial distribution, hypergeometric distribution, geometric distribution,
Poisson distribution and negative binomial
distribution.
Conclusion 5
• The built in list function can help doing many
other analyses such as one way ANOVA,
randomized block design, chi-square test for
K╳1 table, chi-square test for R╳C table,
Wilcoxon rank sum test, etc.
• Generally speaking, this particular engineering
calculator can accomplish lots of interesting
statistical analyses if it’s fully utilized.
References
• CASIO fx-7400G PLUS manual.
• Berenson, Levine, & Krehbiel. Basic Business
Statistics—Concepts and applications. Pearson
International (Edition 11).
The End
• Thank you for your watching!